Skip to content

Commit f955e2f

Browse files
author
Kim Biesbjerg
committed
Check if element has assignedSlot
1 parent 57b20e6 commit f955e2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/VueDatePicker/composables/position.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export const usePosition = ({
225225
const getScrollableParent = function (el: HTMLElement | null): Window | HTMLElement {
226226
if (!el || el === document.body || el.nodeType === Node.DOCUMENT_FRAGMENT_NODE) return window;
227227
if (isScrollable(el)) return el;
228-
return getScrollableParent(el.parentNode as HTMLElement);
228+
return getScrollableParent(el.assignedSlot ? el.assignedSlot.parentElement : el.parentElement);
229229
};
230230

231231
const getShadowPos = (rect?: DOMRect) => {

0 commit comments

Comments
 (0)