Comments (6)
Hi @web-padawan! I started working on that few days ago. So I'm glad that we're on the same page =)
I already added tab-based navigation (tabindex="0"
and :focus
styles) and additional attrs like role="slider"
and aria-valuenow="0"
things.
Going to add keyboard navigation soon.
I'm still not sure what should I use for the Saturation area (I mean role="slider"
or something else). I'm also not a pro in terms of a11y.
P.S. I'm using this picker as a reference, but not sure that the author has done everything right there.
from react-colorful.
Note that Page Up and Page Down allow to change value by multiple steps (10 steps in the example).
Should this be configurable as well?
10% shift per click sounds good I think.
Also, I liked the thing that Vadim mentioned during the podcast — we should move it by ~1% if the user keeps the option pressed. Let's keep that in mind.
from react-colorful.
I checked some of the existing color pickers and found the following alternatives:
Link with assistive text
Used by Lightning design system: https://www.lightningdesignsystem.com/components/color-picker/#Open
<p id="color-picker-instructions" class="slds-assistive-text">Use arrow keys to select a saturation and brightness, on an x and y axis.</p>
<div class="slds-color-picker__custom-range" style="background:hsl(220, 100%, 50%)">
<a class="slds-color-picker__range-indicator" style="bottom:45%;left:46%" href="#" aria-live="assertive" aria-atomic="true" aria-describedby="color-picker-instructions">
<span class="slds-assistive-text">Saturation: 46%. Brightness: 45%.</span>
</a>
</div>
Slider with aria-valuetext
Used by Shoelace: https://shoelace.style/components/color-picker?id=inline
<div part="grid" class="color-picker__grid" style="background-color: rgb(255, 0, 0);">
<span part="grid-handle" class="color-picker__grid-handle" role="slider" aria-label="HSL" aria-valuetext="hsl(0, 100%, 90%)" tabindex="0" style="top: 10.5%; left: 100%;"></span>
</div>
Tested both examples on VoiceOver in Safari and they work (the one by Salesforce has no JS to handle arrow keys).
It would be nice to also test on a Windows device using NVDA.
from react-colorful.
Hey @web-padawan. I finished the first draft. See #63
from react-colorful.
Regarding aria-label
values: we could make them static at first.
I think it would be easier to release a11y features one by one.
P.S. Our primary component's name is saturation
, but probably that's not a proper name for that because users don't choose saturation only there, but a brightness as well.
from react-colorful.
@omgovich I'm currently looking into the implementation and so far it looks good to me 👍
The only note is that Page Up and Page Down are not supported. IMO it would make sense to use those keys with a bigger offset at for Hue and Alpha sliders, and use 0.01
for arrow keys. This would need some refactoring.
from react-colorful.
Related Issues (20)
- Jest 28 with jsdom environment can't parse an exported file from react-colorful HOT 7
- Color pointer not resetting after color change HOT 1
- internationalization support HOT 1
- Chrome style picker? HOT 2
- Unable to drag the pointer HOT 1
- HexColorInput text cursor moves to end of input field after each typed character
- onMouseUp not working if you drag outside of the component HOT 1
- Cannot manipulate the colorful css with Next.js ? HOT 1
- onMouseUp not working if you drag outside of the component
- Conflict when used within modal
- Hue input rotation? HOT 1
- export 'HexAlphaColorPicker' (imported as 'HexAlphaColorPicker') was not found in 'react-colorful' (module has no exports)
- Love the ui. But can we disable Alpha selector? HOT 1
- It would be great to have `onChangeHue` event
- Incorrect pointer position when using CSS zoom HOT 1
- Live demo stops responding if I use a mix of touch screen and mouse input
- Request for React 18 Compatibility HOT 3
- onChange not triggering in HexAlphaColorPicker through RGB slider.
- HexColorPicker does not scale correct at short height
- HexColorPicker + HexAlphaColorPicker have`aria-required-attr` accessibility issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-colorful.