|
18 | 18 | tabindex="0"
|
19 | 19 | @keydown.enter.prevent="handleTimeValue(timeInput.type, true, { keyboard: true })"
|
20 | 20 | @keydown.space.prevent="handleTimeValue(timeInput.type, true, { keyboard: true })"
|
21 |
| - @mousedown="handleTimeValue(timeInput.type)" |
| 21 | + @click="defaultedConfig.timeArrowHoldThreshold ? undefined : handleTimeValue(timeInput.type, false)" |
| 22 | + @mousedown=" |
| 23 | + defaultedConfig.timeArrowHoldThreshold ? handleTimeValue(timeInput.type, true) : undefined |
| 24 | + " |
22 | 25 | @mouseup="clearHold"
|
23 | 26 | >
|
24 | 27 | <template v-if="!props.timePickerInline">
|
|
71 | 74 | tabindex="0"
|
72 | 75 | @keydown.enter.prevent="handleTimeValue(timeInput.type, false, { keyboard: true })"
|
73 | 76 | @keydown.space.prevent="handleTimeValue(timeInput.type, false, { keyboard: true })"
|
74 |
| - @mousedown="handleTimeValue(timeInput.type, false)" |
| 77 | + @click="defaultedConfig.timeArrowHoldThreshold ? undefined : handleTimeValue(timeInput.type, false)" |
| 78 | + @mousedown=" |
| 79 | + defaultedConfig.timeArrowHoldThreshold ? handleTimeValue(timeInput.type, false) : undefined |
| 80 | + " |
75 | 81 | @mouseup="clearHold"
|
76 | 82 | >
|
77 | 83 | <template v-if="!props.timePickerInline">
|
|
199 | 205 | const amPm = ref('AM');
|
200 | 206 | const amPmButton = ref<HTMLElement | null>(null);
|
201 | 207 | const elementRefs = ref<HTMLElement[][]>([]);
|
202 |
| - const isHolding = ref(false); |
203 | 208 | const holdTimeout = ref();
|
204 | 209 |
|
205 | 210 | onMounted(() => {
|
|
375 | 380 | if (holdTimeout.value) {
|
376 | 381 | clearTimeout(holdTimeout.value);
|
377 | 382 | }
|
378 |
| - isHolding.value = false; |
379 | 383 | };
|
380 | 384 |
|
381 | 385 | const handleTimeValue = (type: TimeType, inc = true, opts?: { keyboard?: boolean }): void => {
|
|
390 | 394 | }
|
391 | 395 | if (!opts?.keyboard && defaultedConfig.value.timeArrowHoldThreshold) {
|
392 | 396 | holdTimeout.value = setTimeout(() => {
|
393 |
| - isHolding.value = true; |
394 | 397 | handleTimeValue(type, inc);
|
395 | 398 | }, defaultedConfig.value.timeArrowHoldThreshold);
|
396 | 399 | }
|
|
0 commit comments