+ Start a Discussion
Mounica M 10Mounica M 10 

how to close a pop up on hitting escape button in lightning?


I have a lightning component in which a window pops up on certain command. now i need to close the pop up on clicking ouside of the window or hitting esc button on key pad any ideas? Thank in advance

Siddharth SethSiddharth Seth
Hi Mounica M 10

For this you can use lightning:overlayLibrary. It helps you define modal .Pressing the Escape key or clicking the close button closes the modal.
For more information please refer to https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_lightning_overlayLibrary.htm

Best Regards,
Siddharth S.
AppPerfect Corp.
salesforce@appperfect.com (mailto:salesforce@appperfect.com)