Dropdown component made from popover
I'm trying to make a dropdown component using the new html popover and css anchor positioning apis.
I was wounding if anyone could help me with the semantics and accessibility side of things.
I think I've got it going pretty good but would love a second opinion from others.
In terms of keyboard accessibility, do I just need to add support for the up and down arrow, as well as page up and down? I think everything else should be handle by the
button
elements. Do I just add this as an onkeydown
event listener to the popover element?
Here's the html:
3 Replies
here's the css if you want that too (no JS yet):