Open Ennoriel opened 1 year ago
A two-dimensional slider is currently not defined. I see four possibilities:
Please note:
The ARIA Authoring Practices (APG) Task Force just discussed color picker best practice · Issue #2742 · w3c/aria-practices
.
Before trying the first option "split on two one-dimensional sliders.", I am implementing a simple slider and ran into something that I don't understand.
I thought that in the first case, a wrapper serving as the slider should have the role slider (and all aria-* attributes) and in the second case, both slider thumbs.
But the two first examples of the (single) slider pattern are implemented differently:
Setting the role on the thumb makes it much easier to implement a single component with eather one or two thumbs.
What is the final recomandation?
I don't know if the different implementation was done on purpose. I think it doesn't matter where the role=slider is located. It only matters that role=slider is at the same element that gets the keyboard focus.
After some time, I came up with a new slider component library and made a new version (in beta at the moment) of my color picker library. I used 2 sliders for the picker region, one vertical and one horizontal. On both documentation sites, there are examples and I would be glad to discuss with you if every requirement is met.
In addition, about this advice:
- for blind users the exceeding of a limit value concerning AA or AAA WCAG contrast requirements can be transmitted e.g. via Live Region
I am not sure to know what it means. Could you please explain it?
I am not sure to know what it means. Could you please explain it?
When the slider is operated, the system automatically displays whether the WCAG contrast requirements are met. This is not perceptible with a screen reader. A live region can therefore be used: https://w3c.github.io/aria/#aria-live
At https://svelte-awesome-slider.vercel.app/ the contrasts of the slider bar are not sufficient. e.g. first example: left light blue to white 1.3:1, right 2.1:1.
When operating the slider with page up/down or Pos1/End, the page is scrolled and the slider is no longer visible
At https://svelte-awesome-color-picker-git-v300-ennoriel.vercel.app/ the contrasts are also insufficient (e.g. white text on orange for insufficient contrast has only 2:1; form fields do not have sufficient contrast)
If the pop-up is opened with the colour picker, the focus is not set in the pop-up. In addition, the keyboard focus does not remain in the pop-up.
The buttons to change the colour model are well labelled for blind people, but visual labels do not match, which is a violation of WCAG 2.5.3
Transparency is not taken into account when calculating WCAG contrasts, so that incorrect results are displayed
Thanks for all the feedbacks!
I took them into account for both libraries:
Don't hesitate to let me know if I implemented them correctly or if you find something else that could be improved!
However, I did not understand how to use aria-live:
When the slider is operated, the system automatically displays whether the WCAG contrast requirements are met. This is not perceptible with a screen reader. A live region can therefore be used: https://w3c.github.io/aria/#aria-live
Would you have an example of how to use it?
Don't hesitate to let me know if I implemented them correctly or if you find something else that could be improved!
I won't look at the examples again, firstly I don't have time for that, secondly this is not the place for individual advice and thirdly you might get too one-sided a picture if only I comment - actually others should take part in the discussion
Would you have an example of how to use it?
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
Important for live regions: The (usually empty) live region must already be in the DOM (e.g. <div aria-live=polite></div>
). A short text is then inserted into the live region using JavaScript ("Contrast too low", so that the DOM then looks like this: <div aria-live=polite>Contrast too low</div>
). If further changes are made, the same live region (which now already contains text) can be used to have new messages output by the screen reader. The new text is inserted using JavaScript and the old text is removed.
However, it is important to avoid filling the live region with text every time a value is changed in the colour picker, as long as the text does not change (e.g. repeatedly inserting "Contrast too low", because every operating step would then be associated with unnecessary screen reader output). The live region is only filled with text when the status changes (from too low to sufficient or from sufficient to too low)
Thanks for the documentation and the many advice you gave me.
I am not an expert with this at all. Working with live regions is tough. I'm not very confident about how I should implement it. With one of the speaker I've installed, the live region is sometimes announced before the value change, and sometimes after and I didn't succed to find a way to announce not too much change and not too little by still being clear about what is meant by one of the contrast too low / good enough.
I'm still thinking...
Yes, live regions do not work very reliably and consistently. Then simply leave out the live region and offer a way of using the screen reader to see in text form which WCAG thresholds are not met
As the author of a color picker library, I'd like to make it as accessible as possible (svelte awesome color picker). However there is no such thing as a 2 dimension slider documented anywhere.
The thing is also that the most common color representation is the HSV one which is not very intuitive to explain in labels.
At the moment, the color picker is made of 2 distinct areas:
I have troubles with the 2 dimensions picker to compute the
aria-min
,aria-max
,aria-valuenow
andaria-valuetext
properties. The role and keyboard events are also not standard...I am thinking of dividing the picker in 2 distinct keyboard selectable sliders for each property but would that be better? What would you suggest otherwise? Would that fit in the design patterns?
I have a work in progress version of the picker where I display the 3:0, 4.5:0 and 7:0 contrast levels within the picker and really don't know how to make it accessible the right way.