Skip to content

fix(docs): make animation controls keyboard accessible - #1939

Open
nemo-crypto wants to merge 1 commit into
animate-css:mainfrom
nemo-crypto:fix/docs-keyboard-animation-controls
Open

nemo-crypto wants to merge 1 commit into
animate-css:mainfrom
nemo-crypto:fix/docs-keyboard-animation-controls

Conversation

@nemo-crypto

Copy link
Copy Markdown

The animation names in the documentation playground are clickable spans, so keyboard users cannot focus or activate them. Copy controls are also hidden unless the row is hovered, and their focus outline is removed.

Render animation names as native type="button" controls while preserving their current appearance and click delegation. Reveal the copy control when its row contains keyboard focus, expose its tooltip on focus, and give both controls a visible keyboard focus outline. Update the generator and generated page together.

Validation:

  • The regression fails on the original markup because keyboard traversal cannot reach an animation name.
  • tests/keyboard-controls.js passes in Chromium, Firefox and WebKit at 1280px, 768px and 390px: keyboard traversal, Enter/Space playback, focus visibility, copying the selected class, and existing pointer playback. Clipboard writes are mocked; the system clipboard is not modified.
  • macOS WebKit is tested with Option-Tab (its native navigation mode that includes buttons); Firefox's scroll-container tab stop is accounted for.
  • Generated the docs with npm run docs:pages, checked desktop/mobile-width screenshots, and ran git diff --check.

These are browser viewport simulations, not physical-device or screen-reader tests. To run the optional test, install @playwright/test and its browsers, then run node tests/keyboard-controls.js.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants