mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
refactor(datepicker): fixed focus prevention on inputs
This commit is contained in:
1 parent
3e130c9a0d
commit
69536e21f5
21 files changed
+282
-581
No files matched your search
@@ -5,6 +5,7 @@
|
||||
max-height="90%"
|
||||
height="700px"
|
||||
persistent
|
||||
:retain-focus="false"
|
||||
>
|
||||
<W-loadable :content="subtask" class="h-100">
|
||||
<v-card
|
||||
@@ -26,7 +27,6 @@
|
||||
v-model="subtask.project_code"
|
||||
label="Kód projektu"
|
||||
:value="subtask.project_code"
|
||||
@focus="onInputFocus"
|
||||
class="modal-input"
|
||||
variant="solo"
|
||||
disabled
|
||||
@@ -44,12 +44,10 @@
|
||||
variant="solo"
|
||||
class="modal-input"
|
||||
clearable
|
||||
@focus="onInputFocus"
|
||||
/>
|
||||
|
||||
<v-text-field
|
||||
v-model="subtask.title"
|
||||
@focus="onInputFocus"
|
||||
class="modal-input"
|
||||
label="Názov subtasku"
|
||||
variant="solo"
|
||||
@@ -60,7 +58,6 @@
|
||||
<div class="w-100 modal-input">
|
||||
<Z-datepicker
|
||||
v-model="subtask.deadline"
|
||||
@open="onDateOpen"
|
||||
ref="datepicker-01"
|
||||
label="Deadline"
|
||||
:auto-apply="true"
|
||||
@@ -83,7 +80,6 @@
|
||||
label="Čas"
|
||||
append-inner-icon="mdi-clock-outline"
|
||||
type="time"
|
||||
@focus="onInputFocus"
|
||||
:class="{ error: v$.subtask._deadline_time.$errors.length }"
|
||||
:hint="
|
||||
v$.subtask._deadline_time.$errors
|
||||
@@ -160,7 +156,6 @@
|
||||
label="Časový odhad"
|
||||
:class="{ error: employeeValidations[0]?.duration }"
|
||||
append-inner-icon="mdi-clock-outline"
|
||||
@focus="onInputFocus"
|
||||
@update:model-value="
|
||||
employeeValidations[0]
|
||||
? (employeeValidations[0].duration = false)
|
||||
@@ -222,7 +217,6 @@
|
||||
label="Časový odhad"
|
||||
append-inner-icon="mdi-clock-outline"
|
||||
:class="{ error: employeeValidations[index]?.duration }"
|
||||
@focus="onInputFocus"
|
||||
@update:model-value="
|
||||
employeeValidations[index]
|
||||
? (employeeValidations[index].duration = false)
|
||||
@@ -242,9 +236,6 @@
|
||||
:deletable="index > 0"
|
||||
:editable="true"
|
||||
:ref="`timetable-${index}`"
|
||||
:prevent-input-focus="preventInputFocus"
|
||||
:on-input-focus="onInputFocus"
|
||||
:on-date-open="onDateOpen"
|
||||
:index="index"
|
||||
/>
|
||||
<div class="end-button w-100" v-if="!subtask.id">
|
||||
@@ -352,7 +343,6 @@ import useVuelidate from '@vuelidate/core';
|
||||
import { required, requiredIf, optional } from '@vuelidate/validators';
|
||||
import errorUtils from '@/plugins/lib@auth/_utils/error.utils';
|
||||
import { QuillEditor } from '@vueup/vue-quill';
|
||||
import VuetifyFixFocusMixin from '@/plugins/tm@modal/_mixins/vuetify-fix-focus';
|
||||
import SelectsMixin from '../master-task/_mixins/selects.mixin';
|
||||
import * as FileSaver from 'file-saver';
|
||||
import tmUtils from '@/plugins/tm@_utils/tm.utils';
|
||||
@@ -367,7 +357,7 @@ import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin';
|
||||
|
||||
export default {
|
||||
emits: ['close', 'refresh'],
|
||||
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin, modalMixin],
|
||||
mixins: [SelectsMixin, AutocompleteMixin, modalMixin],
|
||||
|
||||
components: {
|
||||
ZTaskReadonlyInfo,
|
||||
@@ -503,29 +493,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
// Override onDateOpen from VuetifyFixFocusMixin to add logging
|
||||
onDateOpen($event) {
|
||||
// Call the parent mixin's onDateOpen method
|
||||
if (
|
||||
VuetifyFixFocusMixin.methods &&
|
||||
VuetifyFixFocusMixin.methods.onDateOpen
|
||||
) {
|
||||
VuetifyFixFocusMixin.methods.onDateOpen.call(this, $event);
|
||||
}
|
||||
},
|
||||
|
||||
// Override onInputFocus from VuetifyFixFocusMixin to add logging
|
||||
onInputFocus($event) {
|
||||
const target = $event?.target;
|
||||
// Call the parent mixin's onInputFocus method
|
||||
if (
|
||||
VuetifyFixFocusMixin.methods &&
|
||||
VuetifyFixFocusMixin.methods.onInputFocus
|
||||
) {
|
||||
VuetifyFixFocusMixin.methods.onInputFocus.call(this, $event);
|
||||
}
|
||||
},
|
||||
|
||||
toggleEditMode() {
|
||||
if (this.subtask.type == 'office365')
|
||||
return this.$events.emit('show-unable-to-edit-office-task-modal', {
|
||||
@@ -595,7 +562,6 @@ export default {
|
||||
];
|
||||
this.$nextTick(() => {
|
||||
this.v$.$reset();
|
||||
this.setFocusEvent();
|
||||
|
||||
// Reset after modal is fully rendered and v-dialog autofocus has been blocked
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in new issue
Block a user