From d459e8c621edfee0dffd545ea6f6cf28d0d52cbe Mon Sep 17 00:00:00 2001 From: Nikhil Tomar <63502271+2nikhiltom@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:59:30 +0530 Subject: [PATCH] fix(datepicker): focus trap in FireFox (#17969) --- 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, '',