question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Toggle Component: Improve accessibility

See original GitHub issue

Description

The Toggle component is not accessible in it’s current state.

Needs:

  • Keyboard handling (press “enter” to toggle)
  • label validation - if no label provided, add hidden label for screen readers.
  • aria-checked attribute

Versions

fundamental-react: 0.3.0.rc-2 fiori-fundamentals:


NOTE: Where applicable, please include uncropped screen captures.

DISCLAIMER: After triaging an issue, the fundamental-react team will see if it can be reproduced or confirmed. If more information is needed, the fundamental-react team will contact the author. Any issues awaiting responses from the author for more than 7 days will be closed. The author can re-open the issue at a later time if they can present the requested information.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
prsdthkrcommented, Mar 4, 2020

@jbadan I guess having the aria-label set on the input is better. That way, we don’t have to add, associate and style another label element. Also I think aria-label should be a required prop.

0reactions
jbadancommented, Mar 9, 2020

I think we can set the default for our playground pages - but the custom proptype we use for localization will make it required: https://github.com/SAP/fundamental-react/blob/master/src/utils/CustomPropTypes/CustomPropTypes.js#L78 (seen used here in Counter: https://github.com/SAP/fundamental-react/blob/e3e6c9ae7986085a4ce65b39d2da853db258fd06/src/Counter/Counter.js#L36)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessibility - Toggle - Carbon Design System
A toggle is a control that is used to quickly switch between two possible states. They are commonly used for “on/off” switches.
Read more >
Building accessible toggle buttons (with examples for Svelte ...
Toggle buttons might be the biggest missing native HTML element. This post will help you code them right, for all users, in any...
Read more >
Building Inclusive Toggle Buttons - Smashing Magazine
In this inaugural post, I'll be exploring what it takes to make toggle buttons inclusive. As with any component, there's no one way...
Read more >
An accessible toggle | Kitty Giraudel
In this article, I will show a small HTML + CSS only implementation of an accessible toggle that you can basically copy in...
Read more >
Accessibility first: toggle switches - DEV Community ‍ ‍
If the element is disabled we want to somehow show the user they can't interact with it. What I like to do is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found