Skip to content

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

Closed
@jhildenbiddle

Description

@jhildenbiddle

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:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions