function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mounica M 10Mounica M 10 

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

Hello,

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)
408-252-4100
http://www.appperfect.com/salesforce/