From 02d51682a8ab7c9d260bdc22825dc997494661fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Thu, 16 May 2024 15:38:52 -0400 Subject: [PATCH 1/2] Update DatePicker.tsx Enhance calendar visibility conditional rendering This commit introduces an improvement where the calendar is now displayed only when the `isOpen` variable is set to `true`. This change addresses the bug where inconsistencies occurred if a user attempted to alter the date directly via the calendar widget and subsequently tried to modify the date through the corresponding input field. The fix ensures a smoother user experience by maintaining the expected behavior of the calendar's visibility and interaction. --- packages/react-date-picker/src/DatePicker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-date-picker/src/DatePicker.tsx b/packages/react-date-picker/src/DatePicker.tsx index 8748c50a..bba98f00 100644 --- a/packages/react-date-picker/src/DatePicker.tsx +++ b/packages/react-date-picker/src/DatePicker.tsx @@ -637,7 +637,7 @@ export default function DatePicker(props: DatePickerProps) { ref={wrapper} > {renderInputs()} - {renderCalendar()} + {isOpen ? renderCalendar() : null} ); } From 70b48c651b6e69f1899eb66c0c835048843357bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Tue, 25 Jun 2024 09:34:27 -0400 Subject: [PATCH 2/2] Update DatePicker.tsx Fix radix modal issue --- packages/react-date-picker/src/DatePicker.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-date-picker/src/DatePicker.tsx b/packages/react-date-picker/src/DatePicker.tsx index bba98f00..c2c2c5f9 100644 --- a/packages/react-date-picker/src/DatePicker.tsx +++ b/packages/react-date-picker/src/DatePicker.tsx @@ -470,6 +470,7 @@ export default function DatePicker(props: DatePickerProps) { if ( target && + (!target.id || !target.id.startsWith('radix-')) && wrapperEl && !wrapperEl.contains(target) && (!calendarWrapperEl || !calendarWrapperEl.contains(target))