-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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): handle slotted parent transform position #8158
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8158 +/- ##
=======================================
Coverage 82.85% 82.85%
=======================================
Files 113 113
Lines 7647 7567 -80
Branches 1839 1820 -19
=======================================
- Hits 6336 6270 -66
+ Misses 1311 1297 -14 ☔ View full report in Codecov by Sentry. |
Could you review this one ? 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.
This would require a test of some kind to ensure code coverage, but it seems reasonable - I don't know much about "slotted" elements, though, personally so maybe @gkatsev might have some thoughts?
Hey, i have updated the test to cover the change for default and slot element behaviour 🙏 Could you review it when you have time ? 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.
I don't have any real experience of using , but since the if block ensures that this can't affect regular use cases and there's a well commented test, LGTM.
Description
getPointerPosition
for IOS is not handling slot elements and nested web components due to the following:item.parentNode
will stop at the first web component and any transform applied on the outer component won't be part of the calculation andtranslate.x
will be wrong.item.parentNode
will skip the slot parent wrapper entirely, so any transformation applied to the parent wrapper won't be counted.It would be useful to support this as we have a use case where we are displaying a list of videos inside the slides web component.(https://ionicframework.com/docs/api/slides) and here is a simple reproduction sample where the pointer position is miscalculated with a slotted video having a wrapper with transform.
https://codepen.io/weiz18/pen/poOEjzJ?editors=1000
Specific Changes proposed
Please list the specific changes involved in this pull request.
Requirements Checklist