フセヴォロド
KPCKevin Powell - Community
•Created by フセヴォロド on 7/14/2023 in #front-end
Make links not focusable inside a burger menu
I'm trying to create a keyboard accessible menu, but the problem is if
button
/a
/input
are in that menu, they are still focusable. To move menu in-n-out I use translateX
.
The only solution I can think of is conditionally setting each focusable element's tabIndex
to -1
, if menu is closed. Yet I wonder is it the best solution out here?
Codepen: https://codepen.io/Kamidashi/pen/poQaYvZ (Just Tab
through and you'll get what I mean)2 replies