-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CModal: add autofucus and
esc
key support
- Loading branch information
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ecc4920
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now this escape press can not be stopped by a prompt or any other action can not be taken to prevent it, I think also forms inside a modal that use ESC to clear them out might fire the modal close in this manner. onClosed function also does not trigger anything. Then close() is defined after it is being used with that const onKeypress, which makes it less clear where it comes from. Think about some prop to customize this ESC behaviour.
ecc4920
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my case where the visibility state was controlled by the store it just unmounted the component and broke some new features.