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

Auto-positioning when using ShadowDOM and slotted content #828

Closed
biesbjerg opened this issue Apr 13, 2024 · 0 comments · Fixed by #829
Closed

Auto-positioning when using ShadowDOM and slotted content #828

biesbjerg opened this issue Apr 13, 2024 · 0 comments · Fixed by #829
Labels
bug Something isn't working

Comments

@biesbjerg
Copy link

biesbjerg commented Apr 13, 2024

Describe the bug
I am encountering an issue with automatic positioning of the datepicker when it's used within a ShadowDOM slot via a web component. The function getScrollableParent returns Window, even though the picker is within a scrolling container element, which results in the scroll event listener being attached to the incorrect element. Consequently, the datepicker does not reposition itself when the actual container element is scrolled.

This issue can be resolved by modifying getScrollableParent to check if the element is assigned to a slot and, if so, to use the slot's parent element instead.

To Reproduce

  1. Go to https://stackblitz.com/edit/ionic-vue-v7-pd4fmn?file=src%2Fviews%2FHomePage.vue
  2. Click to open a datepicker
  3. Try to scroll it out of view.

Expected behavior
The datepicker should adjust its position in response to scrolling of the containing element.

PR: #829

@biesbjerg biesbjerg added awaiting triage The issue is not reviewed by the maintainers bug Something isn't working labels Apr 13, 2024
@biesbjerg biesbjerg changed the title Supported positioning when using ShadowDOM and slotted content Support auto-positioning when using ShadowDOM and slotted content Apr 13, 2024
@biesbjerg biesbjerg changed the title Support auto-positioning when using ShadowDOM and slotted content Auto-positioning when using ShadowDOM and slotted content Apr 13, 2024
@Jasenkoo Jasenkoo removed the awaiting triage The issue is not reviewed by the maintainers label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants