Skip to content

Commit

Permalink
fix: datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Jan 17, 2025
1 parent b655b4d commit 3e2e570
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/machines/date-picker/src/date-picker.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
send({ type: "INPUT.FOCUS", index })
},
onBlur(event) {
const value = event.currentTarget.value
const value = event.currentTarget.value.trim()
send({ type: "INPUT.BLUR", value, index, fixOnBlur })
},
onKeyDown(event) {
Expand Down
2 changes: 1 addition & 1 deletion packages/machines/date-picker/src/date-picker.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ export function machine(userContext: UserDefinedContext) {

// reset to last valid date
if (!date || !isValidDate(date)) {
if (ctx.inputValue) {
if (evt.value) {
date = ctx.focusedValue.copy()
}
}
Expand Down

0 comments on commit 3e2e570

Please sign in to comment.