Skip to content
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

Unable to focus on toggle options #87

Open
jmsfwk opened this issue Apr 9, 2024 · 5 comments
Open

Unable to focus on toggle options #87

jmsfwk opened this issue Apr 9, 2024 · 5 comments
Labels
enhancement New feature or request v5 Issues for v5 release

Comments

@jmsfwk
Copy link

jmsfwk commented Apr 9, 2024

Describe the bug
It's not possible to use the keyboard to focus on or change a selected toggle checkbox state or toggle radio option.

To Reproduce
Steps to reproduce the behaviour eg:

  1. Go to https://elements.reapit.cloud/?path=/docs/formlayout--docs
  2. Click on the "Status" checkbox
  3. Press Tab
  4. See that focus moves to the "Long Description" text area

Expected behaviour

  • I expect the focus to move to the "Active" checkbox toggle and to be able to change the value using Space.
  • I expect some indication that the focus is within the toggle element.

Screenshots
Screenshot 2024-04-09 at 16 24 44

Device (please complete the following information for web issues):

Additional context

I think the inability to focus on the toggle is caused by the visibility: hidden. Bootstrap use the following declaration, which does solve the issue.

{
  position: absolute;
  clip: rect(0,0,0,0);
  pointer-events: none;
}
@jmsfwk jmsfwk added the bug Something isn't working label Apr 9, 2024
@github-project-automation github-project-automation bot moved this to To Review in Elements Roadmap Apr 9, 2024
@willmcvay
Copy link
Contributor

@jmsfwk Funnily enough I have just raised a PR that is a full sweep of accessibility on the project #89 - this includes the toggle behaviour as per above so should be in prod some time this week. Will update when the release goes out.

@willmcvay
Copy link
Contributor

@jmsfwk This is now fixed and release in v4.2.0

@github-project-automation github-project-automation bot moved this from To Review to Done in Elements Roadmap Apr 10, 2024
@jmsfwk
Copy link
Author

jmsfwk commented Apr 10, 2024

@willmcvay I've tested this on https://elements.reapit.cloud/?path=/docs/formlayout--docs and I don't think it matches the keyboard interactions that you expect from a checkbox or radio button group.

We also use the Elements CSS without React, which I understand you might not support.

Checkbox

On a checkbox toggle I expect that Space will change the state of the toggle (as it does on the plain checkbox).

https://www.w3.org/WAI/ARIA/apg/patterns/switch/

Radio

On a radio group I expect that I would tab into the group and then use Left / Right or Up / Down to move through the options, not Tab.

https://www.w3.org/WAI/ARIA/apg/patterns/radio/

@willmcvay
Copy link
Contributor

@jmsfwk I'll re-open and take a look. Trying to avoid breaking changes at this major version so may be one we have to move into our v5 release - will see what can be done.

@willmcvay willmcvay reopened this Apr 10, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in Elements Roadmap Apr 10, 2024
@willmcvay willmcvay moved this from In Progress to To Review in Elements Roadmap Apr 11, 2024
@willmcvay willmcvay added enhancement New feature or request and removed bug Something isn't working labels Apr 11, 2024
@willmcvay
Copy link
Contributor

The core bug is fixed in the sense the react focus issues is addressed and the toggle is functional. Agree though, this behaviour is preferable and suggest we do this in v5 - I had a look and the desired functionality is hard to achieve without breaking the markup and therefore a breaking change. Will add a v5 flag.

@willmcvay willmcvay added the v5 Issues for v5 release label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v5 Issues for v5 release
Projects
Status: To Review
Development

No branches or pull requests

2 participants