Open davem7714 opened 1 year ago
+1, this would of course have been preferable as default behavior.
What you can do is programmatically listen for whether ESC is pressed and whether the modal is open. -> https://blazored.github.io/Modal/usage/closing-programmatically
I understand how to close the modal programmatically but I'm not clear how to listen for the ESC key being pressed. Any links that discuss this would be helpful. I'll start researching. Thanks!
I too have yet to find a nice way to listen for ESC key, and close ANY modal open. I know there was an attempt to make ESC work for closing, but was later removed due to conflict.
It would really be nice if instead of the user having to click the "X" or somewhere outside of the window to close it. If we could trap the user pressing the ESC key and then execute the onclick of a button in the modal or just call the method that will close the form with a "cancel" that would be great.