Skip to content

Make Enter submit a dialog instead of cancelling it - #177

Merged
switch-nz merged 1 commit into
mainfrom
claude/dialog-enter-submits
Oct 1, 2026
Merged

switch-nz merged 1 commit into
mainfrom
claude/dialog-enter-submits

Conversation

@switch-nz

Copy link
Copy Markdown
Owner

What changes for examiners

Pressing Enter in a dialog's text field cancelled the dialog instead of submitting it: the BitLocker/LUKS unlock dialog, the examiner-name dialogs, New case, Open case, tagging, and every other dialog with a Cancel button.

Cause: each dialog is a <form method="dialog">, and Enter presses the form's first submit button. Cancel comes first in each menu, so Enter was Cancel. The Cancel buttons are now plain buttons (type="button") that close their dialog themselves, which leaves the confirm button as the form's default. Clicking Cancel still cancels, Escape still works.

Verification

  • In a real browser (Playwright), with a value typed and Enter pressed: the examiner-name, New case, Open case and unlock dialogs all close with returnValue = "ok". Before the change the same steps gave "cancel" for all four. Clicking Cancel still gives "cancel".
  • tests/test_dialogs.py checks the markup (no Cancel is a submit button; no dialog's first submit button is a Cancel) and that the script closes the dialog on Cancel; two of its three tests fail on the old markup.
  • Full suite OK, smoke passes. UI-only change (web/index.html, web/app.js).

🤖 Generated with Claude Code

https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz
@switch-nz
switch-nz merged commit a013d93 into main Oct 1, 2026
31 checks passed
@switch-nz
switch-nz deleted the claude/dialog-enter-submits branch October 1, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants