Allow modal popups to be closed by hitting the ESC key on the keyboard.
Expected behavior
TBD:
[ ] Modal popups will close when the user hits the ESCAPE key, mimicking the cancel button behaviour.
[ ] If a model contains form fields*, should we track the "dirty state" of the form and warn if they will close a dirty form?
[ ] If so, should we also do this when they try to close a "dirty" popup using the "Cancel" button?
[ ] As an alternative we could also only activate the ESCAPE hotkey when modal popups don't contain any form fields.
(*) Important! Modal popups containing form fields don't necessary contain a <form> element as HTMX can collect form values via a custom selector via hx-include.
Note: since a redesign is upcoming, maybe we won't have any forms left in modal popups (only confirm/error dialogs) so this behaviour would only be temporary. In that case we can probably ignore the dirty check, or have this ticket on hold until after the redesign.
Thank you for this recap. Seems like a good idea to wait until we have done the redesign, so we don't surprise people with unexpected behaviour and wind up fixing the dirty state anyways.
Enhancement
Allow modal popups to be closed by hitting the ESC key on the keyboard.
Expected behavior
TBD:
(*) Important! Modal popups containing form fields don't necessary contain a
<form>
element as HTMX can collect form values via a custom selector viahx-include
.Note: since a redesign is upcoming, maybe we won't have any forms left in modal popups (only confirm/error dialogs) so this behaviour would only be temporary. In that case we can probably ignore the dirty check, or have this ticket on hold until after the redesign.