Skip to content

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

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions