Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(react-keytips): add specification #228

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

mainframev
Copy link
Contributor

Initial specification for Keytips, might be adjusted after further implementation changes.
Design spec in Figma

@mainframev mainframev mentioned this pull request Aug 29, 2024
29 tasks
Comment on lines +193 to +203
## Accessibility

In terms of accessibility, `Keytip` component is very similar to `Tooltip` - it's a small popup that displays information related to an element, with difference, that `Keytip` can't be displayed by mouse hover over target element. Multiple keytips can be visible at the same time.

- Each `Keytip` is assigned the role `"tooltip"`.
- The `Keytip` target element references the corresponding keytip element using the `"aria-describedby"` attribute, providing a clear association between the target and the keytip (tooltip).
- `Keytips` component has `content` prop, which is responsible for adding the `"aria-describedby"` for default start key sequence.
- `Keytip` is not focusable.
- `Keytip` adds `"aria-keyshortcuts"` attribute to the target element, which contains the key sequence that will trigger the keytip.
- Unlike Tooltip, pressing `Escape` does not always hide the `Keytip`. By default, `Keytip` is configured to use `Escape` as a return sequence. Therefore, if there are ancestor keytips, pressing it will not hide the current `Keytip` but will instead display the ancestor keytips.
- Focus stays on the trigger element while `Keytip` is displayed.
Copy link
Contributor Author

@mainframev mainframev Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smhigley 👋🏻

Here are a couple of a11y things I am not sure about:

  • Can Keytip have role "tooltip"? (in the previous version there was no role for Keytip)
  • In v8 Keytip was adding a aria-describedby on the target element with id of the root layer and current keytip (so it's announcing start sequence and sequence of current keytip).
  • In the current draft implementation I added both (aria-describedby and aria-keyshortcuts), so after the aria-describedby announced it will announceshortcuts available of aria-keyshortcuts. So, question if we can have both? or if not, which way is better in your opinion?

I'd be very grateful if you could take a look on this :)

@mainframev mainframev merged commit 6307a97 into microsoft:main Sep 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants