Comments (8)
the docs need more clarity regarding this.
I've added an Accessibility section near the top of the Button documentation. Let me know if you think this will be helpful or if it could be improved.
from source.
Thanks for adding this 👍 I think this is a good step, if I have any better ideas I will share
from source.
Hi @liywjl, can you give me an example of where this would be useful? Note, if you want only an icon to be visible, you can pass the hideLabel
prop
from source.
Here is an example of a work around we had to do in a recent update because children
was a mandatory prop: https://github.com/guardian/discussion-rendering/pull/345/files#diff-b5928ae26d810ad0f00591179422632ce95a546bf892f9a776ace078f7b19d4dR296-R308
from source.
we had to add an empty object as child to satisfy the prop requirement:
<Button icon={XXX} hideLabel={true}>{}</Button>
ideally we wouldn't need to add the empty object:
<Button icon={XXX} hideLabel={true}/>
from source.
Thanks @liywjl. The reason we make the children mandatory is to ensure something is announced by screen readers. Can you think of some text that will help a screen reader user understand the purpose of the button? Apologies if you have implemented an alternative way of doing this.
from source.
I see that makes a lot more sense! I think however this behaviour isn't quite obvious, I noticed others leaving the object blank as well during upgrade. I am unsure what might be the best way of communicating this to other developers? Maybe add some documentation? Maybe use a separate prop for description?
from source.
Yes, it sounds like a tricky one. I agree the docs need more clarity regarding this.
a separate prop for description
Can you flesh out that proposal a little? Do you mean an optional prop that would be announced by screen readers when children are not passed? At this point, we need to make the (unsafe and untrue) assumption that everybody is testing their work with a screen reader, and that they question how to ensure that a button with no text label is still announced by a screen reader.
I noticed others leaving the object blank as well during upgrade
That's not good 😞 My expectation was that if the API caused friction like this, people would question why that friction exists and try to address it. Perhaps they checked the docs and the docs weren't obvious, so they assumed it was a bug, found a workaround and moved on? It's good that you raised the question here, so I really appreciate your engagement with this issue 🙂
from source.
Related Issues (20)
- Blurry `Lines` when zoomed HOT 1
- test issue
- this it not attached to a repo
- Untangling emotion from source-foundations HOT 1
- Add Toggle switch component to code
- test
- Field active state should override field error state
- Text box field active state does not persist
- Remove tooltip prop from ToggleSwitch
- React warning on LinkButton: each child should have a key prop HOT 5
- Revert work around for chrome browser HOT 2
- Tiles layout broken in IE11 HOT 1
- RadioGroup allow `supporting` prop to be able to use `ReactNode` HOT 2
- Full width Radio labels HOT 6
- Animation overlay span in Checkbox intercepts Selenium click events aimed at the underlying input HOT 2
- Inclusion of new gift icon HOT 3
- Responsive column widths
- `SvgChevronRightDouble` please! HOT 2
- Support success message in TextArea
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 source.