fix(keys): a list inside the topmost layer walks by keyboard
The list keys are the page's and an open layer silences them, so the player's related videos could only be reached by Tab. A layer now names its root element; with the focus on a row inside the topmost one, j/k, the arrows and Enter walk that list, the walk stays inside the layer, and the player's seek and volume arrows leave a focused row alone.
This commit is contained in:
@@ -147,7 +147,7 @@ export default function Modal({
|
||||
// An effect event, so a new handler each render never re-registers: the stack id is assigned once per mount.
|
||||
const close = useEffectEvent(onClose);
|
||||
useEffect(() => {
|
||||
const id = pushLayer();
|
||||
const id = pushLayer({ root: () => rootRef.current });
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (takeEscape(e, id)) {
|
||||
e.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user