You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enter on Cancel saves edited text instead of cancelling #424
While editing an incident title, pressing Enter with Cancel focused saves the draft instead of cancelling. The editor also intercepts qualifying Enter shortcuts on unrelated controls.
This behavior predates the StyleX migration in #408.
Reproduction
Open a test incident and edit its title.
Change the text.
Tab past Save onto Cancel.
Press Enter.
The changed draft is submitted. Expected behavior is to discard the draft without calling onSave.
Verified in a browser using the actual EditableTextField component. Enter on focused Cancel invoked the save callback once. For multiline fields, Ctrl/Cmd+Enter has the same scope problem; plain Enter remains a newline shortcut.
Cause and suggested fix
The document-level keydown listener calls preventDefault() and save() without checking the event target. This suppresses native button activation.
Handle the editor shortcuts on the input and textarea. Let Save, Cancel, and unrelated controls retain their own native keyboard behavior.
Regression coverage should include Cancel in both single-line layouts, an unrelated button activated by Enter, native Save activation, and multiline newline/Ctrl/Cmd+Enter behavior.
Activity