Skip to content

Add Enter and Escape key handlers to KeycodeModal#396

Open
joaoLouceiro wants to merge 1 commit into
the-via:mainfrom
joaoLouceiro:feature/accept-custom-key-on-enter
Open

Add Enter and Escape key handlers to KeycodeModal#396
joaoLouceiro wants to merge 1 commit into
the-via:mainfrom
joaoLouceiro:feature/accept-custom-key-on-enter

Conversation

@joaoLouceiro
Copy link
Copy Markdown

@joaoLouceiro joaoLouceiro commented Apr 26, 2026

Adds keyboard event handling to the KeycodeModal (custom-keycode-modal.tsx).

  • Pressing ENTER will behave as if the user clicked the CONFIRM button, persisting the keycode if the value at the TextInput is valid and closing the modal.
  • Pressing ESCAPE will behave as if the user clicked the CANCEL button, closing the modal without persisting the changes.

The feature takes into account if the Autosuggestions Combobox is open, so it doesn't interfere with it's functionality.
This means that, if the Autosuggestions Combobox is open:

  • Pressing ENTER will select the highlighted item in the Autosuggestions Combobox, (or, if no item is selected, will leave the Input as is), and close the Combobox.
  • Pressing ESCAPE will close the Combobox.

fixes #395

…hlighted

Adds keyboard event handling to the custom keycode modal so that
pressing Enter confirms a valid keycode entry when the autocomplete
dropdown is closed or no suggestion is highlighted. Also suppresses the
global Enter/Escape handler when Downshift has already handled those
keys, preventing double-firing.
@joaoLouceiro
Copy link
Copy Markdown
Author

It looks like this build failed because of the issue being solved by #392.

Is there any way I can help?

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.

ENTER and ESCAPE handlers for Modal elements

1 participant