From 4de65a850ef812ca8eb5512d24065a4825c6b717 Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Mon, 10 Jun 2024 11:55:11 -0700 Subject: [PATCH 1/2] Allow keep typing for datetime picker --- .../src/components/PreciseDateTimePicker.vue | 80 +++++++++++++++++-- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/src/dispatch/static/dispatch/src/components/PreciseDateTimePicker.vue b/src/dispatch/static/dispatch/src/components/PreciseDateTimePicker.vue index b31f03ce3e80..1e711d53d2bb 100644 --- a/src/dispatch/static/dispatch/src/components/PreciseDateTimePicker.vue +++ b/src/dispatch/static/dispatch/src/components/PreciseDateTimePicker.vue @@ -12,7 +12,8 @@ density="compact" hide-details="true" maxlength="2" - @update:model-value="filterNumeric('month', $event)" + @update:model-value="filterNumeric('month', $event, 'day')" + @keydown="handleKeyPress('day', $event)" @blur="validateMonth" @focus="highlightText" @click="highlightText" @@ -27,7 +28,9 @@ density="compact" hide-details="true" maxlength="2" - @update:model-value="filterNumeric('day', $event)" + ref="day" + @update:model-value="filterNumeric('day', $event, 'year')" + @keydown="handleKeyPress('year', $event)" @blur="validateDay" @focus="highlightText" @click="highlightText" @@ -42,7 +45,9 @@ density="compact" hide-details="true" maxlength="4" - @update:model-value="filterNumeric('year', $event, true)" + ref="year" + @update:model-value="filterNumericYear('year', $event, 'hour')" + @keydown="handleKeyPress('hour', $event)" @blur="validateYear" @focus="highlightText" @click="highlightText" @@ -57,7 +62,9 @@ density="compact" hide-details="true" maxlength="2" - @update:model-value="filterNumeric('hour', $event)" + ref="hour" + @update:model-value="filterNumeric('hour', $event, 'minutes')" + @keydown="handleKeyPress('minutes', $event)" @blur="validateHour" @focus="highlightText" @click="highlightText" @@ -72,7 +79,9 @@ density="compact" hide-details="true" maxlength="2" - @update:model-value="filterNumeric('minutes', $event)" + ref="minutes" + @update:model-value="filterNumeric('minutes', $event, 'seconds')" + @keydown="handleKeyPress('seconds', $event)" @blur="validateMinutes" @focus="highlightText" @click="highlightText" @@ -87,7 +96,9 @@ density="compact" hide-details="true" maxlength="6" + ref="seconds" @update:model-value="filterNumericSeconds('seconds', $event)" + @keydown="handleKeyPress(null, $event, true)" @blur="validateSeconds" @focus="highlightText" @click="highlightText" @@ -117,6 +128,7 @@