Skip to content

Commit

Permalink
refactor: DateInput make InputRefreshKey more predictable by simply i…
Browse files Browse the repository at this point in the history
…ncrememnting
  • Loading branch information
LimeWub committed Jul 24, 2023
1 parent ba74f7a commit b42fcca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/components/date-input/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const DateInput = React.forwardRef<HTMLInputElement, DateInputProps>(
const parsedInputDate = dayjs(newDate)
setDate(newDate)
setDateString(parsedInputDate.format(dateFormat))
setInputRefreshKey(Math.random()) // Remount the Input
setInputRefreshKey((prevKey) => prevKey + 1) // Remount the Input
},
[dateFormat]
)
Expand Down

0 comments on commit b42fcca

Please sign in to comment.