You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rovingIndex({
element: node, // required: the container to get roving index ux
target: "button", // optional: a query selector for which children should be focusable
prev: ["ArrowUp", "ArrowLeft"], // optional: default is "ArrowLeft"
next: ["ArrowDown", "ArrowRight"] // optional: default is "ArrowRight"
})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If we want to use the up and down key instead?
or multiple keys for prev and next because the layout could change from horizontal to vertical?
It seems using the key name is supported in all modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#example
if
event.key
was used instead ofevent.keyCode
API idea.
#4
Beta Was this translation helpful? Give feedback.
All reactions