From 735bd30ecf4eefe61d2b9cbc89459ff618efc954 Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 30 Jun 2023 10:27:32 -0400 Subject: [PATCH] Fix #4579: Calendar mask correct hook (#4582) --- components/lib/calendar/Calendar.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/lib/calendar/Calendar.js b/components/lib/calendar/Calendar.js index 3bdbeae664..c21f137369 100644 --- a/components/lib/calendar/Calendar.js +++ b/components/lib/calendar/Calendar.js @@ -2490,7 +2490,7 @@ export const Calendar = React.memo( } }); - useUpdateEffect(() => { + React.useEffect(() => { let unbindMaskEvents = null; if (props.mask) { @@ -2510,7 +2510,8 @@ export const Calendar = React.memo( return () => { props.mask && unbindMaskEvents && unbindMaskEvents(); }; - }, [props.mask]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [props.disabled, props.mask, props.readOnlyInput]); useUpdateEffect(() => { setCurrentView(props.view);