Hacker News new | ask | show | jobs
by andypants 552 days ago
There's no event for the dialog about to close, only an event for after the dialog closes. You can prevent default on the enter key and space key, but that obviously breaks the form ux.

There is an event for the dialog about to close from pressing the escape key. No idea why it's only for closing via escape key.

1 comments

I think they meant prevent the form submission on the `submit` event and use JavaScript to make the submission.

https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending...