-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Tooltip: refactor using ariakit #48222
Comments
Looked also at the pending PR, seems to me an important point has been missed and there's a bit of confusion on what an accessible name and an accessible description are. In both ARIA 1.1 and ARIA 1.2, the role=tooltip is meant to provide an accessible description. It must not be used to provide the accessible name.
Focus on the part 'referenced through the use of aria-describedby'. From what I see, Ariakit uses aria-labelledby instead, thus providing the accessible name by referencing the element with role=tooltip. That's not valid. It's incorrect and can lead to potential accessibility issues when the visible text of a control and its actual accessible name mismatch. Worth noting there's no official example of the ARIA tooltip design pattern yet. Work to develop a tooltip example is tracked by issue 127. It's still in the works. The ARIA Authoring Practices Task Force are still discussing what a role=tooltip even is and what it should do. I'd strongly suggest to have a read at the relevant issues on their GitHub repo before continuing this implementation with Ariakit. Clarify the use of role=tooltip Tooltip role should allow referencing by aria-labelledby To my understanding, the current state of the tooltip pattern example is here, where it's clear it must not be used to provide the accessible name. Tooltip code example for ARIA Authoring Practices Guide (APG) It's perfectly fine revealing the accessible name on hover/focus by the means of a 'visual tooltip' as long as it doesn't use a role=tooltip. That's what the current |
Hey @afercia , thank you for the early feedback! We definitely plan to have a conservative approach with introducing the new Regarding the You can test the new behaviour by adding the Would that change be enough, in your opinion? |
Hi @afercia, thank you for taking a look! I initially added After my discussion with @ciampo, I opened a related issue in the ariakit repo to ask the authors on their decision to not have |
The points mentioned by @afercia were fixed in the latest version of Ariakit, and a section about using Tooltip as a label was added to https://ariakit.org/components/tooltip#tooltips-are-descriptions |
What problem does this address?
The decision was made to refactor the 'legacy' Tooltip component due to the complexity of the existing component, the time it would take to refactor and migrate to typescript, and to utilize an accessible library that is actively maintained.
This issue branches off of what @t-hamano started in #42753, and aims to track the completion of the second step outlined by @ciampo:
What is your proposed solution?
The following is a WIP, but my general tl;dr plan so far is:
First phase (MVP):
Research
ariakit
Create
Testing
Documentation
README.md
Implementation
Second phase (TBD):
ariakit
The text was updated successfully, but these errors were encountered: