-
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
Color picker: CopyButton is unlabeled and has buggy description and tooltip #57157
Comments
Hey @afercia, |
@Sanyam-jain30 hello. Generally, all contributors don't need to be assigned to an issue, it's just a matter of submitting a pull request :) |
Worth noting that in #41222 which is a pull request that refactored a little the color picker, the tooltip seems to work correctly. See the video titled 'after' in the pull request description: it is clearly visible the tooltip text changes from 'Copy' to 'Copied!'. |
Got it. Thank you for your response. |
Since we already have #51740 to track this issue, I think it would be more efficient to list all of the unlabelled component instances that we come across directly in that issue's description. (cc @WordPress/gutenberg-components )
That's correct, and from what I understand, it's the recommended attribute to use with a tooltip — and it was also recommended in #48222 (comment).
I agree that "Copy" should be used as the accessible name, regardless of the tooltip — that should be as easy as adding
This behavior was probably introduced in #54312, which fixed a performance regression due exactly to the fact that all tooltips were always rendered to the DOM even when not visible, so I'm not sure we really have an alternative there.
That is a regression that I also noticed and logged in #57210 (which I closed in favour of this PR). One interesting aspect to notice is that the tooltip shows correctly when interacting with the button using the keyboard.
cc @WordPress/gutenberg-design |
Let's not change the button to a text-label button. It is intentionally an icon button so as to manage its prominence. The primary flow here is one of changing colors, where copying the hex code is a tertiary action, after even pasting into the input, or selecting from the input and copying. The button exists there as a shortcut for an advanced flow, and thus needs a lower footprint. |
@ciampo it is not. I think I also mentioned previously that the ARIA tooltip pattern is still under discussion in teh W3C groups as there is no agreement on its implementation. We should not use it for now. The ariakit implementation has problems in at least tow aspects:
@jasmussen As mentioned in several other issues and PRs, icon only buttons are inherently an accessibility problem. FOr accessibility, we should avoid them and only use them when there is not enough space for visible text. I'm reporting that this is an accessibility problem that needs to be solved but you're not providing an alternative sollution. I'm not sure just saying 'no' without providing an alternative solution is ok under all aspects.
This is only a visual consideration and it's not relevant to solve the underlying accessibility problem. I would greatly appreciate that designers in thisi project stop thinking only visually and evolve towards a truly accessible design. Thanks. |
@ciampo I'm not sure running behind every instance where contributors mistakenly omitted to label a button or other interactive controls is 'efficient' in any way and I'm not sure that would be the best way to spend our time. In the almost 7 years I've been following this project I've encountered several cases of unlabelled interactive controls. After 7 years, contributors keep coding, reviewing, and merging unlabelled controls. And they get released to users. To be fair, I'm not sure that's acceptable. My intent isn't blaming anyone but it is a fact that some contributors to this project clearly lack the necessary education and knowledge to code in an accessible way. Labeling controls isn't rocket science. It's a basic requirement and I would say it's basic HTML. As I see it, we have two options:
Honestly, I think we need to find a way. Nothing is impossible. |
Opened ariakit/ariakit#3242 to discuss directly with @diegohaz |
Thanks @ciampo I would like to remind everyone that on this comment from March I did strongly recommend to not use a |
Hi Afercia, thanks for fostering this healthy discussion. I can do nothing but agree with the second part: we really need to embrace truly accessible design, and we should do so considering all accessibility needs. I am neither a UX expert nor an accessibility one, and while I absolutely agree we need to ensure visual accessibility, I believe we should also consider the effect our decisions have on users with different needs or expertise. As said, I'm no expert in either field; hence, I'm unable to propose an informed path forward, but I felt the need to share that adding text to every button by default can result in an overwhelming UI where most possible actions fight for the user's attention, resulting also in a less accessible software for many people. 🙏 |
Thanks @priethor for sharing your thoughts and your commitment to universal design, I appreciate it ❤️ I think we should clarify some basic points:
This is not a personal opinion, it's a fact backed up by years of research, user testing, and actual data. Icons are not universally usable. As such, we need to avoid icons as much as possible. I'm requesting here to change this button to use visible text. I do realize the argument about visual prominence. Luckily, we have designers in this project that can take care of making the button with visible text less visually prominent as desired. Using visible text wherever there is enough space to do it is an accessibility requirement. What I expect here is a new design proposal that solves both needs: accessibility and visual prominence. What I do not expect here is some feedback that just says 'no' without providing an alternative solution. Thanks. |
Thanks again for taking the time to discuss this, Andrea! 🙇♂️
Would you mind pointing to some of the research that backs up those facts? It would be beneficial for all contributors to see these strong statements backed up by studies and well-known accessibility organizations; I personally haven't found anything related to icon-only buttons in WCAG guidelines, for example. However, the answers I find on the topic are more of a gray area (disclaimer again: I'm not an a11y expert), with opposing opinions, including the acceptance of icon-only buttons when their look and purpose are universally accepted, which seems applicable for the case of the copy button if we check the Google results for "copy button" (note: this is not a fact but my opinion loosely held by the Google results!). Moreover, there are recommendations to avoid cluttering the UI with text to help dyslexic users, which would mean text is not
I see your point and empathize with it; however, if the same logic is applied from the design point of view, something similar could be said about the stance that having text is a requirement, as no other solution is provided. There is no easy way forward as long as we draw these unmovable red lines; we all need to make some compromises and find some common ground. Thinking out of the box: what if we concentrate less on finding the perfect solution for the default experience and provide customizable options so that users can decide how much verbose they want/need the UI during onboarding/through settings? |
Description
WHen selecting a custom color via the color picker, there's a 'copy' button to copy the custom colod code.
This button has a few bugs:
hideOnClick={ false }
. As such, there is no feedbackn for users that their action was successful.Step-by-step reproduction instructions
gutenberg/packages/components/src/color-picker/color-copy-button.tsx
Lines 64 to 69 in db617ee
aria-describedby
is set dynamically only when hovering or focusing.Copied!
.Copied!
.Screenshots, screen recording, code snippet
Animated GIF to illustrate:
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: