react icon indicating copy to clipboard operation
react copied to clipboard

ActionList: Allow items to remain focusable when disabled

Open TylerJDev opened this issue 1 year ago • 10 comments

Allows disabled items in ActionMenu and SelectPanel to remain focusable. This stems from feedback we've received from the Accessibility Team.

Changelog

Integration test PR: https://github.com/github/github/pull/324056 Passes with small modifications (minus flakey tests), requires only one change to a test in Dotcom.

Changed

  • Allows ActionList.Item to keep focus if it's within an ActionMenu or SelectPanel context.

Rollout strategy

  • [x] Patch release
  • [ ] Minor release
  • [ ] Major release; if selected, include a written rollout or migration plan
  • [ ] None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

  • [ ] Added/updated tests
  • [ ] Added/updated documentation
  • [x] Added/updated previews (Storybook)
  • [ ] Changes are SSR compatible
  • [x] Tested in Chrome
  • [ ] Tested in Firefox
  • [ ] Tested in Safari
  • [ ] Tested in Edge
  • [ ] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)

TylerJDev avatar Apr 08 '24 17:04 TylerJDev

🦋 Changeset detected

Latest commit: cb5468924cae138a3a37290777686959329dc825

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Apr 08 '24 17:04 changeset-bot[bot]

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 95.91 KB (+0.12% 🔺)
packages/react/dist/browser.umd.js 96.24 KB (+0.05% 🔺)

github-actions[bot] avatar Apr 08 '24 18:04 github-actions[bot]

Should require only one change in Dotcom (a modification to a test), other than that it appears that the tests related to this change pass.

TylerJDev avatar May 08 '24 20:05 TylerJDev

Should require only one change in Dotcom (a modification to a test), other than that it appears that the tests related to this change pass.

That's great!

It looks like we can only make the dotcom change after merging this PR, correct?

siddharthkp avatar May 17 '24 14:05 siddharthkp

@siddharthkp, yup that should be it!

TylerJDev avatar May 22 '24 16:05 TylerJDev

This PR should be ready for a review!

cc: @primer/engineer-reviewers

TylerJDev avatar Jul 12 '24 21:07 TylerJDev

Hi @TylerJDev,

How do you feel about this PR now that inactive elements are released: Docs | Story

Is focusing a disabled item without feedback still the way to go OR should we replace those instances with inactiveText instead?

siddharthkp avatar Jul 31 '24 14:07 siddharthkp

How do you feel about this PR now that inactive elements are released: Docs | Story

Is focusing a disabled item without feedback still the way to go OR should we replace those instances with inactiveText instead?

We'd want to keep the two focusable since inactive items can still trigger actions, unlike disabled items. We're mainly making disabled items focusable because they are still present in the accessibility tree even though they are disabled, so if a user goes into a menu that has 8 items including disabled items, they'll know which item(s) are disabled.

TylerJDev avatar Aug 05 '24 13:08 TylerJDev

:wave: Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/336021

primer-integration[bot] avatar Aug 05 '24 14:08 primer-integration[bot]

inactive items can still trigger actions

Oh! Totally didn't expect that!

siddharthkp avatar Aug 06 '24 12:08 siddharthkp