mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
29 lines
553 B
TypeScript
29 lines
553 B
TypeScript
export default {
|
|
// 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)
|
|
})
|
|
},
|
|
|
|
onDateFocus($event) {
|
|
if ($event == undefined) {
|
|
this.preventInputFocus = true
|
|
}
|
|
},
|
|
|
|
onInputFocus($event) {
|
|
if (this.preventInputFocus) {
|
|
$event.target.blur()
|
|
this.preventInputFocus = false
|
|
}
|
|
}
|
|
}
|
|
} |