Skip to content

Commit

Permalink
Fix #3515: Calendar fix controlled value change
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Oct 28, 2022
1 parent ea8aa17 commit 7c3f611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2489,10 +2489,10 @@ export const Calendar = React.memo(
}, [props.onViewDateChange, props.value]);

useUpdateEffect(() => {
if (previousValue !== props.value && (!viewStateChanged.current || visible)) {
if (previousValue !== props.value) {
updateInputfield(props.value);
}
}, [props.value, visible]);
}, [props.value]);

useUpdateEffect(() => {
updateInputfield(props.value);
Expand Down

0 comments on commit 7c3f611

Please sign in to comment.