-
-
Notifications
You must be signed in to change notification settings - Fork 166
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
In the previous version of this widget (i.e. the last version of vue3-date-time-picker
), we were able to automatically scroll the page to get the whole datepicker on the screen by doing something like this:
<template>
<Datepicker
:id="dateId"
@open="opened"
/>
</template>
<script lang="ts" setup>
const uid = '1'
const dateId = `datepicker-${uid}`
const opened = async () => {
await nextTick()
document.getElementById(dateId)?.scrollIntoView()
}
</script>
After updating to this package, the same thing doesn't work. The best workaround we've found so far is:
<template>
<Datepicker
:uid="uid"
:transitions="false"
@open="opened"
/>
</template>
<script lang="ts" setup>
const uid = '1'
const dateId = `dp-menu-${uid}`
const opened = () => {
setTimeout(() => {
document.getElementById(dateId)?.scrollIntoView()
}, 200)
}
</script>
Describe the solution you'd like
It would be great if the original solution could work. Maybe I've missed something though and there's a better way to do this 😅
Describe alternatives you've considered
The alternative is in the above description
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working