-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Disable parent scrolling and swiping in lightbox #334
Conversation
// TODO(dvoytenko): configure how to close. Or maybe leave it completely | ||
// up to "on" element. | ||
this.element.addEventListener('click', () => this.close()); | ||
gestures.onGesture(TapRecognizer, () => this.close()); | ||
gestures.onGesture(SwipeXYRecognizer, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for my knowledge purposes. how does adding an empty subscriber block the scroll and side-swipe events?
thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gestures are exclusive. I.e. you can have a "tap" and a "swipe" at the same time. It's very different from events which fire all at the same time and can overlap. Once you say "I recognize swipeX", no other conflicting gesture will be allowed which is what we want here. In a way you can consider scroll and side-swipe as other gestures. Practically, once gesture is recognized it consumes all of the pointer events by stopping propagation and preventing default.
other than my question. LGTM |
Disable parent scrolling and swiping in lightbox
Closes #332.
Closes #74.