Hacker News new | ask | show | jobs
by runarberg 1553 days ago
I think it depends on the implantation. I think it is more important that your drop down is keyboard accessible. I usually expand my menus with ":focus-within" as well as ":hover" and make sure that one element which is always visible is also focusable. That way you can tab to it and the menu expands.
1 comments

Element visibility should not be triggered via focus or hover. Visibility states should be triggered with a button click or enter key press.
Indeed, you should probably just use "<details>" and "<summary>" for drop downs today (works perfectly without any javascript and have accessibility built in). CSS only dropdowns were a hack for an era before these elements were widely supported.