Skip to content

Commit

Permalink
fix(DatePicker): when entering a date without separators, valid date …
Browse files Browse the repository at this point in the history
…should call onChange (#972)
  • Loading branch information
toby-daigle authored Aug 15, 2024
1 parent 4ecca0f commit 91b42e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/components/date-picker/date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ export const Datepicker = forwardRef(({
const numericalFormat = getNumericalDateFormat(dateFormat);
if (numericalFormat && /^\d+$/.test(value) && value.length === numericalFormat.length) {
const date = parse(value, numericalFormat, new Date());
setSelectedDate(date);
handleInputChange(date);
}
}, [dateFormat]);
}, [dateFormat, handleInputChange]);

return (
<>
Expand Down

0 comments on commit 91b42e4

Please sign in to comment.