Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Commit 2bb0aef

Browse files
committed
fix: Inline positioning on autoPosition enabled
1 parent 7594b9e commit 2bb0aef

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Vue3DatePicker/Vue3DatePicker.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,21 @@
159159
160160
onMounted(() => {
161161
mapExternalToInternalValue();
162-
window.addEventListener('scroll', onScroll);
163-
window.addEventListener('resize', onResize);
162+
if (!props.inline) {
163+
window.addEventListener('scroll', onScroll);
164+
window.addEventListener('resize', onResize);
165+
}
166+
164167
if (props.inline) {
165168
isOpen.value = true;
166169
}
167170
});
168171
169172
onUnmounted(() => {
170-
window.removeEventListener('scroll', onScroll);
171-
window.removeEventListener('resize', onResize);
173+
if (props.inline) {
174+
window.removeEventListener('scroll', onScroll);
175+
window.removeEventListener('resize', onResize);
176+
}
172177
});
173178
174179
const wrapperClass = computed(

0 commit comments

Comments
 (0)