mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
fix(task-modal): fixed calendar position after first click on month switch
This commit is contained in:
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);
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user