From ac68abb107a06903f84a646f1b9a40a1a313e71b Mon Sep 17 00:00:00 2001 From: Nikhil Tomar Date: Tue, 5 Nov 2024 18:07:25 +0530 Subject: [PATCH] fix(datepicker): focus trap in FireFox --- packages/react/src/components/DatePicker/DatePicker.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/react/src/components/DatePicker/DatePicker.tsx b/packages/react/src/components/DatePicker/DatePicker.tsx index 466049c721aa..62b373e45335 100644 --- a/packages/react/src/components/DatePicker/DatePicker.tsx +++ b/packages/react/src/components/DatePicker/DatePicker.tsx @@ -880,9 +880,6 @@ const DatePicker = React.forwardRef(function DatePicker( const closeCalendar = (event) => { calendarRef.current.close(); // Remove focus from endDate calendar input - if (document.activeElement instanceof HTMLElement) { - document.activeElement.blur(); - } onCalendarClose( calendarRef.current.selectedDates, '', @@ -918,12 +915,7 @@ const DatePicker = React.forwardRef(function DatePicker( document.activeElement === endInputField.current && calendarRef.current.isOpen ) { - event.preventDefault(); calendarRef.current.close(); - // Remove focus from endDate calendar input - document.activeElement instanceof HTMLElement && // this is to fix the TS warning - document?.activeElement?.blur(); - onCalendarClose( calendarRef.current.selectedDates, '',