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

feat: keep action elements focusable when disabled #3040

Merged
merged 18 commits into from
Sep 5, 2024

Conversation

TomMenga
Copy link
Contributor

@TomMenga TomMenga commented Aug 29, 2024

Notes to reviewer

I believe that not all the button-like components that previously extended the SbbDisabledTabIndexActionMixin should be part of this development.
The components that, imho, should be excluded are:

  • sbb-popover-trigger
  • sbb-slider

Not sure about:

  • sbb-mini-button => In some cases it should be focusable (mini-button-group) and in others it should not (e.g. when it's part of a form field)
  • link and button-links

TODO

  • Decide what to do with arrow navigation (especially for the sbb-menu)

Preflight Checklist

Issue

This PR Closes #2862

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

See Review Guidelines for more information what is checked during review process.

Changes

Changes in this pull request:

  • For a11y purposes, keep button-like elements focusable when disabled

Browsers

I tested the build on the following browsers:

  • Firefox Desktop
  • Chrome Desktop
  • Edge Desktop
  • Safari Desktop
  • Chrome Mobile
  • Safari Mobile

Screen readers

I tested the build on the following browsers:

  • JAWS Firefox Desktop
  • JAWS Chrome Desktop
  • NVDA Firefox Desktop
  • NVDA Chrome Desktop
  • VoiceOver Safari Desktop
  • VoiceOver Chrome Desktop
  • VoiceOver Safari Mobile
  • Android Accessibility Suite Chrome Mobile

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Does this introduce a breaking change?

  • Yes
  • No

Other information

@jeripeierSBB
Copy link
Contributor

A topic that came to my mind was that we have several components where we implemented arrow key navigation. Normally (as I remember) we exclude the disabled ones (e.g. menu.ts line 153). Maybe this still makes sense, but it would not be the same as arriving with tab there. Especially for the menu where both navigations are possible. But there are other components I think.

@TomMenga
Copy link
Contributor Author

A topic that came to my mind was that we have several components where we implemented arrow key navigation. Normally (as I remember) we exclude the disabled ones (e.g. menu.ts line 153). Maybe this still makes sense, but it would not be the same as arriving with tab there. Especially for the menu where both navigations are possible. But there are other components I think.

I believe the menu is the only component allowing both arrow and tab navigation. In general, if there is arrow navigation, you cannot tab between them

@jeripeierSBB
Copy link
Contributor

A topic that came to my mind was that we have several components where we implemented arrow key navigation. Normally (as I remember) we exclude the disabled ones (e.g. menu.ts line 153). Maybe this still makes sense, but it would not be the same as arriving with tab there. Especially for the menu where both navigations are possible. But there are other components I think.

I believe the menu is the only component allowing both arrow and tab navigation. In general, if there is arrow navigation, you cannot tab between them

Ok, this can be. But also with only arrow-navigation components, should disabled buttons be reached now? Or don't we have any such case?

@TomMenga
Copy link
Contributor Author

A topic that came to my mind was that we have several components where we implemented arrow key navigation. Normally (as I remember) we exclude the disabled ones (e.g. menu.ts line 153). Maybe this still makes sense, but it would not be the same as arriving with tab there. Especially for the menu where both navigations are possible. But there are other components I think.

I believe the menu is the only component allowing both arrow and tab navigation. In general, if there is arrow navigation, you cannot tab between them

Ok, this can be. But also with only arrow-navigation components, should disabled buttons be reached now? Or don't we have any such case?

I'm not sure about it. Because in lists and groups, like the stepper or tab-group, screen readers allow users to navigate between items (even when disabled). Maybe we could ask for advice from an a11y expert

@github-actions github-actions bot temporarily deployed to pr3040 August 29, 2024 10:30 Inactive
@github-actions github-actions bot temporarily deployed to pr3040-diff August 29, 2024 10:31 Inactive
@github-actions github-actions bot temporarily deployed to pr3040 August 29, 2024 12:40 Inactive
@github-actions github-actions bot temporarily deployed to pr3040-diff August 29, 2024 12:41 Inactive
@TomMenga TomMenga changed the title feat(button-action-elements): keep elements focusable when disabled [WIP] feat(button-action-elements): keep elements focusable when disabled Sep 2, 2024
@TomMenga TomMenga self-assigned this Sep 2, 2024
@TomMenga TomMenga added the pr: lead review required A lead review is required for this pull request label Sep 2, 2024
@github-actions github-actions bot added the pr: peer review required A peer review is required for this pull request label Sep 2, 2024
@github-actions github-actions bot temporarily deployed to pr3040 September 2, 2024 08:42 Inactive
@github-actions github-actions bot temporarily deployed to pr3040 September 5, 2024 09:49 Inactive
@github-actions github-actions bot temporarily deployed to pr3040-diff September 5, 2024 09:50 Inactive
Copy link
Contributor

@jeripeierSBB jeripeierSBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

src/elements/button/mini-button/readme.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added pr: lead review approved Pull request has been approved by a lead review and removed pr: lead review required A lead review is required for this pull request labels Sep 5, 2024
@jeripeierSBB jeripeierSBB changed the title feat(button-action-elements): keep elements focusable when disabled feat: keep action elements focusable when disabled Sep 5, 2024
Copy link
Contributor

@kyubisation kyubisation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Nice work! 😃

@TomMenga TomMenga merged commit a9410ba into main Sep 5, 2024
19 of 20 checks passed
@TomMenga TomMenga deleted the feat/disabled-button-a11y branch September 5, 2024 14:01
@github-actions github-actions bot added pr: peer review required A peer review is required for this pull request and removed pr: peer review required A peer review is required for this pull request labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diff-available pr: lead review approved Pull request has been approved by a lead review pr: peer review required A peer review is required for this pull request pr: visual review required preview-available
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: focus on disabled buttons
3 participants