Skip to content

Commit dc2e010

Browse files
Fix input not updating the value when blurred and the date doesn’t change
1 parent ef818fb commit dc2e010

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useDateInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function useDateInput({
5757
if (!focused) {
5858
setValue(isValidAndSelectable(selectedDate) ? formatDate(selectedDate) : '')
5959
}
60-
}, [selectedDate]) // eslint-disable-line react-hooks/exhaustive-deps
60+
}, [selectedDate, focused]) // eslint-disable-line react-hooks/exhaustive-deps
6161

6262
return {
6363
onFocus: handleFocus,

0 commit comments

Comments
 (0)