Fix focus gone wrong
This commit is contained in:
parent
020d8e3631
commit
f3b81bc540
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue