Skip to content

Focus the first field of a new receipt or line, and let Enter pick a suggestion - #115

Merged
Frognar merged 2 commits into
mainfrom
claude/project-thread-559kco
Nov 14, 2026
Merged

Frognar merged 2 commits into
mainfrom
claude/project-thread-559kco

Conversation

@Frognar

@Frognar Frognar commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Requested by Frognar · project thread

What changes

  • Focus on open. New receipt, new line and rename dialogs now put the cursor in the first field (store / item / new name), so you can type right away. The fields already had AutoFocus, but MudDialog (default focus Element) then focused its own container and took the focus back. These dialogs now use DefaultFocus.None when the field focuses itself. Editing an existing receipt or line, and duplicating one, behave as before.
  • Enter in the suggestion list. With the autocomplete list open, Enter now picks the highlighted suggestion and does not submit the form. The browser submits the form on key down, while MudAutocomplete picks the option on key up, so the form used to save the half-typed text (All instead of Allegro). A small global key-down handler (wwwroot/js/keyboard.js) cancels the browser default only for an input with role="combobox" and aria-expanded="true". Once the list is closed, Enter saves as before.

Verified

Ran the API with a local Postgres and drove it in headless Chromium (Playwright):

  • New receipt: focus lands in "Sklep". Typing All, ArrowDown to Allegro and Enter leaves the dialog open with Allegro in the field. A second Enter saves a receipt for Allegro.
  • New line: focus lands in "Towar", and typing goes straight into it.
  • Before the change, the same steps left focus on the dialog's DIV, and the first Enter saved the receipt.

Generated by Claude Code

…suggestion

The dialog focused itself after the field's autofocus, so typing went nowhere
until the field was clicked. Enter with the suggestion list open submitted the
form on key down, saving the half-typed text instead of the highlighted name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012weRUwFTaoHfFvd7L4x12i
@Frognar
Frognar merged commit 99b1bdd into main Nov 14, 2026
3 checks passed
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