From 1c5441a940c3213a2cc729798795ebbaee41838b Mon Sep 17 00:00:00 2001 From: Toni Cabrera Date: Fri, 17 Jan 2025 14:00:24 -0300 Subject: [PATCH] Revert "wasnt necessary to use has to focus" This reverts commit def452f0bbebc7ebc96f304ec49b8994870cee4b. --- packages/core/src/DateField/DateFieldInput.vue | 10 +++++++++- packages/core/src/shared/date/useDateField.ts | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/core/src/DateField/DateFieldInput.vue b/packages/core/src/DateField/DateFieldInput.vue index 0f6e2c665..47b3f3244 100644 --- a/packages/core/src/DateField/DateFieldInput.vue +++ b/packages/core/src/DateField/DateFieldInput.vue @@ -43,7 +43,12 @@ const readonly = computed(() => rootContext.readonly.value) const isInvalid = computed(() => rootContext.isInvalid.value) function handleFocusOut(e: FocusEvent) { - hasLeftFocus.value = true; + if (rootContext.programmaticContinuation.value) { + hasLeftFocus.value = false + } + else { + hasLeftFocus.value = true + } } function handleFocusIn(e: FocusEvent) { @@ -62,8 +67,11 @@ function handleFocusIn(e: FocusEvent) { cancelable: true, }) + hasLeftFocus.value = false; handleSegmentKeydown(event) } + } else { + hasLeftFocus.value = true; } } diff --git a/packages/core/src/shared/date/useDateField.ts b/packages/core/src/shared/date/useDateField.ts index d847d5ef4..9c4f1fa5b 100644 --- a/packages/core/src/shared/date/useDateField.ts +++ b/packages/core/src/shared/date/useDateField.ts @@ -335,6 +335,8 @@ export function useDateField(props: UseDateFieldProps) { * `prev` value so that we can start the segment over again * when the user types a number. */ + console.log("🚀 ~ updateDayOrMonth ~ props.programmaticContinuation.value:", props.programmaticContinuation.value) + console.log("🚀 ~ updateDayOrMonth ~ props.hasLeftFocus.value:", props.hasLeftFocus.value) if (props.hasLeftFocus.value && !props.programmaticContinuation.value) { props.hasLeftFocus.value = false prev = null