#6917 - inputDate_inputTime_improviments #552

Merged
alexm merged 8 commits from 6917-inputDate_inputTime_improviments into test 2024-07-16 11:12:55 +00:00
1 changed files with 7 additions and 3 deletions
Showing only changes of commit 4f36a78681 - Show all commits

View File

@ -72,15 +72,18 @@ watch(
watch(
() => formattedTime.value,
async (val) => {
let position = 3;
const input = inputRef.value?.getNativeElement();
if (!val || !input) return;
const [hh, mm] = val.split(':');
if (parseInt(hh) >= 10 || mm != '00') return;
let [hh, mm] = val.split(':');

porque 10?

porque 10?
Outdated
Review

pq menos de 10 ja es 09, 08, 07, etc

pq menos de 10 ja es 09, 08, 07, etc
hh = parseInt(hh);
if (hh >= 10 || mm != '00') return;
Review

Porque hay 2?

Porque hay 2?
Review

Con 1 no funcionaba entiendo que vue aún no ha actualizado el valor con 1 solo

Con 1 no funcionaba entiendo que vue aún no ha actualizado el valor con 1 solo
await nextTick();
await nextTick();
input.setSelectionRange(3, 3);
if (!hh) position = 0;
input.setSelectionRange(position, position);
},
{ immediate: true }
);
@ -99,6 +102,7 @@ watch(
style="min-width: 100px"
:rules="$attrs.required ? [requiredFieldRule] : null"
@click="isPopupOpen = false"
@focus="inputRef.getNativeElement().setSelectionRange(0, 0)"
>
<template #append>
<QIcon