Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Esc dismisses Modal component #386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

astroboogie
Copy link

Related Issue:
#316

Summary:
Pressing the Esc key dismisses the Modal component for:

  • CreateNewProjectWizard
  • ProjectConfigurationModal
  • AppSettingsModal

To do:

  • Project icon selection should support left, right, up & down navigation & enter key to move the focus out of the selection area.
  • Escape key should dismiss modals

@@ -73,6 +77,12 @@ class Modal extends PureComponent<Props, State> {
}
}

handleKeyboardEvent = (event: any) => {
if (event.keyCode === 27) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. Escape handling is working but I would use if (event.key === 'Escape') { }.
We could also leave it with the keyCode as it's only one key here but with the string, it's more readable.

@grimxreaper
Copy link

Hi! Does this completely fix issue #316 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants