mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-28 21:18:47 +00:00
prevent focus root element when route became focusable
This commit is contained in:
parent
1c2b2c1911
commit
d7ad6517a7
1 changed files with 1 additions and 5 deletions
|
|
@ -21,10 +21,6 @@ const FocusableProvider = ({ children, onRoutesContainerDomTreeChange, onModalsC
|
|||
modalsContainer: modalsContainer,
|
||||
contentContainer: contentContainerRef.current
|
||||
});
|
||||
if (focusable) {
|
||||
contentContainerRef.current.focus();
|
||||
}
|
||||
|
||||
setFocusable(focusable);
|
||||
};
|
||||
const routesContainerDomTreeObserver = new MutationObserver(onDomTreeChange);
|
||||
|
|
@ -39,7 +35,7 @@ const FocusableProvider = ({ children, onRoutesContainerDomTreeChange, onModalsC
|
|||
}, [routesContainer, modalsContainer, onRoutesContainerDomTreeChange, onModalsContainerDomTreeChange]);
|
||||
return (
|
||||
<FocusableContext.Provider value={focusable}>
|
||||
{React.cloneElement(React.Children.only(children), { ref: contentContainerRef, tabIndex: -1 })}
|
||||
{React.cloneElement(React.Children.only(children), { ref: contentContainerRef })}
|
||||
</FocusableContext.Provider>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue