Skip to content

fix(web): submit event form with Mod+Enter from color swatch - #2563

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/fix-mod-enter-color-focus-b66a
Aug 4, 2026
Merged

fix(web): submit event form with Mod+Enter from color swatch#2563
cursor[bot] merged 2 commits into
mainfrom
cursor/fix-mod-enter-color-focus-b66a

Conversation

@tyler-dane

@tyler-dane tyler-dane commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

CMD/Ctrl+Enter did nothing when focus stayed on an event color radio after changing color. Mod+Enter was registered without ignoreInputs: false, and useAppShortcut passed ignoreInputs: undefined into TanStack setOptions, which clobbered the Mod-key default (ignoreInputs: false) on re-render. Title/description still worked via a local onKeyDown path that color radios never received.

This registers Mod+Enter with EVENT_FORM_PLAIN_HOTKEY_OPTIONS (same as Mod+D), omits undefined hotkey option keys so TanStack defaults survive re-renders, and stops the local field handler from also calling onSubmitForm so text fields submit exactly once.

Simplicity

Minimal fix: reuse the existing form hotkey options constant, build useHotkey options without spreading undefined, and align local Mod+Enter with Mod+D (preventDefault only). Test helpers merged to one Mod dispatch.

Automated validation

  • Focused web tests for useAppShortcut and EventForm (color-swatch Mod+Enter, title once-submit, Mod+radio after rerender): 41 pass
  • bun lint: clean for touched files (3 pre-existing warnings elsewhere)

Independent review

Confirmed high finding fixed: dual Mod+Enter submit from text fields after enabling global ignoreInputs:false. Local handler now only preventDefaults; once-submit regression added. No other confirmed findings.

Test plan

  • bun test:web packages/web/src/shortcuts/useAppShortcut.test.ts packages/web/src/views/Forms/EventForm/EventForm.test.tsx
  • bun lint
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 4, 2026 15:47
Pass ignoreInputs:false for Mod+Enter like other form hotkeys, and omit
undefined options in useAppShortcut so TanStack Mod defaults survive
re-renders after color selection.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Leave Mod+Enter submit to the global hotkey; local handleIgnoredKeys only
preventDefaults, matching Mod+D. Adds a title-field once-submit regression
and simplifies the Mod dispatch test helpers.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@cursor
cursor Bot merged commit 47df437 into main Aug 4, 2026
20 checks passed
@cursor
cursor Bot deleted the cursor/fix-mod-enter-color-focus-b66a branch August 4, 2026 16:00
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