Home › Forums › CSS › How to keep submenu navigation open after you click off? › Reply To: How to keep submenu navigation open after you click off?
March 25, 2016 at 6:43 am
#239770
Participant
Focus will only remain on an element if the user doesn’t click on anything else on the page. Take a look at this demo:
http://codepen.io/kvana/pen/PNjqJQ
If you click on the list item it will gain focus and turn red, but if you click anywhere else on the page it will lose focus.
It is possible to build an accordion menu with focus states, but I don’t think anyone could recommend doing that as focus can behave unpredictably on non-form elements (especially on mobile devices).
I would strongly encourage you to keep pursuing a javascript solution.