Typically, when you hit the ESC key, that closes a modal. But if this modal contains a form that the user needs to fill out, that would mean that hitting ESC (sometimes, inadvertently) closes the modal and they lose all the information they just provided in the form.
So that said, what's the best way to go about it? Would it be better to:
- Make sure the modal doesn't go away if the user hits the ESC key
- Allow the use of ESC, but if the user hits ESC, we prompt them that they might lose the information they just typed in