Skip to content

Commit

Permalink
Revert "wasnt necessary to use has to focus"
Browse files Browse the repository at this point in the history
This reverts commit def452f.
  • Loading branch information
acabreragnz committed Jan 17, 2025
1 parent def452f commit 1c5441a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/core/src/DateField/DateFieldInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -62,8 +67,11 @@ function handleFocusIn(e: FocusEvent) {
cancelable: true,
})
hasLeftFocus.value = false;
handleSegmentKeydown(event)
}
} else {
hasLeftFocus.value = true;
}
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/shared/date/useDateField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c5441a

Please sign in to comment.