-
-
Notifications
You must be signed in to change notification settings - Fork 25
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: moai/lib/core/src/dialog/main/main.tsx Lines 56 to 58 in 6dd5286
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: