fix(task-modal): fixed calendar position after first click on month switch

This commit is contained in:
Matej Glasnák committed 2025-09-12 10:42:14 +02:00
1 parent c1ead219e6
commit f38d45160c
4 files changed
+156 -120

No files matched your search

@@ -1,29 +1,37 @@
export default {
// Mixin to fix autofocus on v-input in modals where date selects are used
data() {
return {
preventInputFocus: false
}
},
// Mixin to fix autofocus on v-input in modals where date selects are used
data() {
return {
preventInputFocus: false,
};
},
methods: {
setFocusEvent() {
document.querySelectorAll('.v-autocomplete input').forEach(input => {
input.addEventListener('focus', this.onInputFocus)
})
},
methods: {
setFocusEvent() {
document.querySelectorAll('.v-autocomplete input').forEach((input) => {
input.addEventListener('focus', this.onInputFocus);
});
},
onDateFocus($event) {
if ($event == undefined) {
this.preventInputFocus = true
}
},
onDateFocus($event) {
if ($event == undefined) {
this.preventInputFocus = true;
}
},
onInputFocus($event) {
if (this.preventInputFocus) {
$event.target.blur()
this.preventInputFocus = false
}
}
}
}
onDateOpen($event) {
if ($event == undefined) {
this.preventInputFocus = true;
}
},
onInputFocus($event) {
setTimeout(() => {
if (this.preventInputFocus) {
$event.target.blur();
this.preventInputFocus = false;
}
}, 100);
},
},
};