-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Modals] you can, in fact, prevent the Esc key from closing <dialog> #13
Comments
Can "cancel" be default-prevented? |
Yep, check out the example. |
Right. So the only issue is then preventing this to become a highjacking tool for the back button. E.g. we can make |
Right, I agree with that issue. In particular, if we just said that the Android back button should close dialogs the same way that Esc does on desktop, including the I'll also note that, just at a surface level, the existence of the I think |
I think |
https://github.com/slightlyoff/history_api/blob/master/history_and_modals.md says
However, this is not true: you can intercept the
keydown
event and cancel it. https://jsbin.com/lifahuqopa/edit?html,outputThere's even a specifically-designed event, that fires on the dialog itself, named
cancel
, for this purpose: https://jsbin.com/yadizivato/edit?html,outputI'm unsure how much this impacts of the rest of the explainer. Certainly it impacts the proposal for dialog integration. Hmm. But what about custom modals?
Credit to https://mobile.twitter.com/samthor/status/1339712302535208961
The text was updated successfully, but these errors were encountered: