Skip to content

Commit 79da481

Browse files
dhrimovyjose
andauthored
Fix: IE11 close issue fix
* IE11 close issue fix * Also fix focus issue, if there actually was a focused element * refactor: use optional chaining Co-authored-by: Youssouf EL Azizi <[email protected]>
1 parent 0e6d9f6 commit 79da481

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const Popup = forwardRef<PopupActions, PopupProps>(
108108
) => {
109109
if (!isOpen || disabled) return;
110110
setIsOpen(false);
111-
if (isModal) (focusedElBeforeOpen.current as HTMLElement).focus();
111+
if (isModal) (focusedElBeforeOpen.current as HTMLElement)?.focus();
112112
setTimeout(() => onClose(event), 0);
113113
};
114114

0 commit comments

Comments
 (0)