-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot press Escape to close Dialog #249
Comments
Yeah... the problem is we are binding the "onEscape" event at the wrapper div of the dialog: This makes the code real simple, but it won't work if the user is not focusing on the dialog (technically: document.activeElement is inside the wrapper div). At the moment I'm not really sure what should be done here:
Anyway, should look at other leading dialog to see how they are handling this. |
The problem is the dialog is not focused when the dialog shows up. So you can't close dialog via keydown event until you got focused on them. I have to quickly look on rc-dialog, which used by ant.design, and see that they focus on the dialog content, which inside the wrapper. Understandable because when you show up the dialog, which has a |
I totally agree with focusing on the content of dialog whenever it is opened. |
oh thanks @monodyle ! Didn't know w3 has an example for dialog! |
Can not close the Dialog by pressing Escape. It is easy to see in the Basic example of Dialog in Moai docs:
https://docs.moaijs.com/?path=/docs/components-dialog--primary
The text was updated successfully, but these errors were encountered: