Navbar drop menus: no keyboard focus / no touch device access

View https://libocca.org/ as an example. Notice that the "Learn" and "About" drop menus are not accessible either via keyboard navigation or on touch devices.

This issue has been addressed in docsify-themeable via a plugin. The fix involves the following:

  • Ensure that top-level text-only items are wrapped in a <span> tag with tabindex="0" to allow the text to receive focus.
  • Add focusin and focusout event listeners to simulate :focus-within behavior in legacy browsers. This allow for users to navigate the navbar with the keyboard.

The issue with the plugin is that it is sometimes triggered before the navbar has rendered. When this happens, the "fix" is not applied. If the above logic was added to docsify, the fix would be reliable the the docisfy-themeable plugin unnecessary.

Details here: