-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard events propagate to other components when lightGallery is open #1092
Comments
I utilized events to disable keyboard navigation on the other slider when opening lightGallery and solved my problem. Clean enough solution! keep up the good work |
Hey @unitedworx, I'm sorry, somehow I missed this at all. Yes, I think we can prevent the propagation except for inline galleryies. |
The issue, at least in my case, is that none of the DOM elements within lightGallery have focus when it opens. Keyboard events originate from the element which has focus, so depending on what the user interacted last with on my site the event was bubbling up through the DOM from an unexpected place and another event handler was being called first. In case anyone has the same issue my workaround for this is to focus one of the buttons in the toolbar when lightGallery opens and attach an event hander to the container to handle keyboard events myself.
|
Hi there
it seems that then i press the arrow buttons to navigate lightgallery when its open the keyboard evens will propagate to another gallery component which sits behind lightgallery and will move that gallery as well.
Is there a way to tell lightGallerry to stop propagation on those events?
I know i can disable the keyboard events on the other gallery component and manually bind the arrow keys fro it so i can check if lightgallery is open not to fire the events, however this is ugly!
If there is a way to tell lightGallery to stop propagating the keyboard events when its open it will be a clean and nice solution.
The text was updated successfully, but these errors were encountered: