Skip to content
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

fix(dom): account for translated parent in pointer position #7079

Merged
merged 5 commits into from
Feb 4, 2021

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Feb 3, 2021

Since we switched to using adding up offsets to calculate the pointer position relative to the current element, we've had some issues, particularly on iOS, where a translated parent would cause us to miscalculate the position. This is currently a quickfix for the issue, and I'd like to spend some time to figure out a better solution that hopefully won't require us to iterate through the DOM and add up the transform matrix.

y: 0
};

if (browser.IS_IOS) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on iOS, iterate up the DOM tree and add up all the translation transforms so that we can modify the pageX and pageY coordinates for changedTouches to account for it.

@gkatsev
Copy link
Member Author

gkatsev commented Feb 3, 2021

If I can't find a better solution, I could at least improve this solution so that we don't iterate up the DOM tree each time that getPointerPosition is called, but I think it's good enough for a quickfix.

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good for a quick fix.

@gkatsev gkatsev merged commit 542cead into main Feb 4, 2021
@gkatsev gkatsev deleted the pointer-position-translate branch February 4, 2021 16:33
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
…ideojs#7079)

Since we switched to using adding up offsets to calculate the pointer position relative to the current element, we've had some issues, particularly on iOS, where a translated parent would cause us to miscalculate the position. This is currently a quickfix for the issue, and I'd like to spend some time to figure out a better solution that hopefully won't require us to iterate through the DOM and add up the transform matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants