fix(datepicker): improve focus handling and scroll position restoration in modal

This commit is contained in:
Matej Glasnák committed 2025-10-14 01:42:41 +02:00
1 parent 056b27b016
commit 61fc55d313
3 files changed
+77 -22

No files matched your search

@@ -4,14 +4,13 @@
<button @click="$emit('removeTimeblock')" class="x-button">x</button>
</div>
<div
@click="openDatepicker('datepicker')"
@click="handleDatepickerClick"
class="datepicker-wrapper"
ref="datepicker-wrapper"
>
<Datepicker
:model-value="timeblock.date"
ref="datepicker"
@open="onDateOpen"
@update:model-value="updateDate"
format="dd.MM.yyyy"
locale="sk"
@@ -104,6 +103,14 @@ export default {
},
methods: {
handleDatepickerClick() {
// Pass the datepicker wrapper element reference to the mixin
const scrollTarget = this.$refs['datepicker-wrapper'];
this.onDateOpen(scrollTarget);
// Open the datepicker
this.openDatepicker('datepicker');
},
async openDatepicker(ref) {
this.$refs[ref].openMenu();
},