Fix focus gone wrong

pull/228/head
Lim Chee Aun 2023-09-15 01:10:58 +08:00
rodzic 020d8e3631
commit f3b81bc540
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -39,7 +39,9 @@ function Modal({ children, onClose, onClick, class: className }) {
}}
tabIndex="-1"
onFocus={(e) => {
modalRef.current?.querySelector?.('[tabindex="-1"]')?.focus?.();
if (e.target === e.currentTarget) {
modalRef.current?.querySelector?.('[tabindex="-1"]')?.focus?.();
}
}}
>
{children}