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
UI preventScrolling - Only capture subsequent events if event target matches #3322
Conversation
Generated by 🚫 dangerJS |
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.
Preventing pointer clicks on the element when you add preventScrolling
is an issue with ui.js, and should be fixed in ui.js.
We want to prevent scrolling on all touch devices, not just the ones with useragent strings that match our OS.mobile
check. We should either update the pointer event handling or use a different element for dragging.
@@ -109,7 +109,7 @@ function initInteractionListeners(ui) { | |||
|
|||
removeHandlers(ui, WINDOW_GROUP); | |||
if (type === 'pointerdown' && e.isPrimary) { | |||
if (!passive) { |
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.
Does this work everywhere?
I was thinking we defer pointer capture https://github.com/jwplayer/jwplayer/compare/wip/ui-pointer-capture-when-dragging?expand=1
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.
@robwalch I think defer is cleaner and safer. I will close this PR
This PR will...
Call
setPointerCapture
to ui elements withpreventScrolling
options only if the event target matches the ui element.Why is this Pull Request needed?
"preventScrolling" option on desktop calls
el.setPointerCapture
, resulting the upcoming events to be only captured in that element.Since
_wrapperElement
is the element (which contains controls), any events afterpointerdown
on controls that are forwarded to_wrapperElement
are ignored, making the controls not clickable.Are there any points in the code the reviewer needs to double check?
Are there any Pull Requests open in other repos which need to be merged with this?
Addresses Issue(s):
JW8-5643