I have a lightning component where a popup opens up on certain instruction. now i want to close this popup when even Esc button on keypad is hit.
1 Answer
As far as I am concerned, the easiest way would be to use the lightning:overlayLibrary component in order to achieve what you are looking for. This component supports Out of the box closing when hitting the ESC key or pressing the cancel button.
Pressing the Escape key or clicking the close button closes the modal.