dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.18k stars 3.31k forks source link

Feat: Temporarily pause focus trap #1968

Open jeroenkroese opened 2 years ago

jeroenkroese commented 2 years ago

First of all, thanks for a great library and excellent work with V5!

My feature request would be to be able to temporarily pause the focus trap. I have a registered element in the lightbox, which opens an alert component on top of the lightbox. This alert component has its own focus trapping functionality, but it seems to be interfering with Photoswipe. It would help if there was a way to temporarily pause and later reinstate Photoswipe's trapping.

My current implementation using stopPropagation() is not ideal, since it breaks the focus trap of the alert component.

jiangts commented 1 year ago

+1, facing the same problem.