Skip to content

Commit b3d85b0

Browse files
committed
Avoid @close from details component when inputs are focused to avoid a copy operation from closing the record
1 parent 74f050b commit b3d85b0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

components/applications/pomodoro/WlPomodoroRecordDetails.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<div class="inline-flex flex-col">
44
<WlLabel ref="startDateRef" for="pomodoro-record-details-start">Start</WlLabel>
55
<WlTimeInput
6-
id="pomodoro-record-details-start" v-model="startDate" show-seconds
7-
@keyup.enter="listeners.enterStartDate"
6+
id="pomodoro-record-details-start" v-model="startDate" show-seconds
7+
@keyup.enter="listeners.enterStartDate"
88
/>
99
</div>
1010
<div class="inline-flex flex-col">
1111
<WlLabel ref="endDateRef" for="pomodoro-record-details-end">End</WlLabel>
1212
<WlTimeInput
13-
id="pomodoro-record-details-end" v-model="endDate" show-seconds
14-
@keyup.enter="listeners.enterEndDate"
13+
id="pomodoro-record-details-end" v-model="endDate" show-seconds
14+
@keyup.enter="listeners.enterEndDate"
1515
/>
1616
</div>
1717
<div class="inline-flex flex-col">
@@ -109,6 +109,11 @@ const listeners = {
109109
}
110110
},
111111
close() {
112+
if (document.activeElement?.tagName === 'INPUT') {
113+
// Avoids a copy operation will close the record.
114+
return
115+
}
116+
112117
emits('close')
113118
}
114119
}

0 commit comments

Comments
 (0)