mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 22:26:57 +01:00
Fix focus gone wrong
This commit is contained in:
parent
020d8e3631
commit
f3b81bc540
1 changed files with 3 additions and 1 deletions
|
@ -39,7 +39,9 @@ function Modal({ children, onClose, onClick, class: className }) {
|
||||||
}}
|
}}
|
||||||
tabIndex="-1"
|
tabIndex="-1"
|
||||||
onFocus={(e) => {
|
onFocus={(e) => {
|
||||||
|
if (e.target === e.currentTarget) {
|
||||||
modalRef.current?.querySelector?.('[tabindex="-1"]')?.focus?.();
|
modalRef.current?.querySelector?.('[tabindex="-1"]')?.focus?.();
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
Loading…
Reference in a new issue