stable

Clone or download

Read-only

request #20915 : Focusing an input, select or textarea prevents `escape` key from closing modal

Having focus on an input, select or textarea in a modal will prevent it from closing when hitting the escape key. It makes it possible to use the default behavior rather than closing the modal. For exemple, hitting the escape key on an open select will close it, or it will close options for auto-completing a text input. However it makes it difficult to close the modal, and even more when navigating with the keyboard in a modal filled with form fields. Having the escape key taking focus out of such fields allows a second escape to close the modal. Change-Id: I59f4d8fa02a1b2a061045f6a78180f4561e90805

Modified Files

Name
M src/themes/tlp/src/js/modal.test.ts +26 −30 Go to diff View file
M src/themes/tlp/src/js/modal.ts +6 −9 Go to diff View file