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.
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
returnsWindow
, 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
Expected behavior The datepicker should adjust its position in response to scrolling of the containing element.
PR: #829