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

ActionList: Allow items to remain focusable when disabled #4481

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

TylerJDev
Copy link
Contributor

@TylerJDev TylerJDev commented Apr 8, 2024

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

  • 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

Copy link

changeset-bot bot commented Apr 8, 2024

🦋 Changeset detected

Latest commit: 39e8c3f

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

Copy link
Contributor

github-actions bot commented Apr 8, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 103.94 KB (+0.02% 🔺)
packages/react/dist/browser.umd.js 104.3 KB (+0.08% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4481 April 8, 2024 18:01 Inactive
@TylerJDev TylerJDev marked this pull request as ready for review April 9, 2024 15:00
@TylerJDev TylerJDev requested a review from a team as a code owner April 9, 2024 15:00
@TylerJDev TylerJDev requested a review from siddharthkp April 9, 2024 15:00
@siddharthkp siddharthkp added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Apr 9, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 April 11, 2024 13:33 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 April 24, 2024 14:52 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 May 8, 2024 11:03 Inactive
@TylerJDev
Copy link
Contributor Author

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.

@siddharthkp
Copy link
Member

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?

@TylerJDev
Copy link
Contributor Author

@siddharthkp, yup that should be it!

@github-actions github-actions bot temporarily deployed to storybook-preview-4481 June 21, 2024 17:48 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 July 12, 2024 20:49 Inactive
@TylerJDev
Copy link
Contributor Author

This PR should be ready for a review!

cc: @primer/engineer-reviewers

@siddharthkp siddharthkp changed the title Allow items to remain focusable when disabled ActionList: Allow items to remain focusable when disabled Jul 24, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 August 6, 2024 16:04 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 August 6, 2024 19:07 Inactive
const menuItemProps = {
onClick: clickHandler,
onKeyPress: !buttonSemantics ? keyPressHandler : undefined,
'aria-disabled': disabled ? true : undefined,
'data-inactive': inactive ? true : undefined,
'data-loading': loading && !inactive ? true : undefined,
tabIndex: disabled || showInactiveIndicator ? undefined : 0,
tabIndex: focusable ? undefined : 0,
Copy link
Member

Choose a reason for hiding this comment

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

Am i reading this wrong or does this feel opposite of what it says?

when focusable=true, we remove tabIndex with tabIndex: undefined and
when focusable=false, we set tabIndex to 0 (which would make it focusable?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is mainly adding an additional conditional and placing it in focusable.

(disabled && !inferredItemRole) || showInactiveIndicator instead of disabled || showInactiveIndicator

This change will only apply if the container is an ActionMenu or a SelectPanel, otherwise the functionality will remain the same. So if an item inside of an ActionMenu is disabled, it will receive 0.

Let me know if we should opt for a different name here, or if it's still confusing!

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Left 1 comment for potential bug (everything else looks good)

Copy link
Contributor

github-actions bot commented Nov 2, 2024

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

@github-actions github-actions bot added the Stale label Nov 2, 2024
@TylerJDev TylerJDev removed the Stale label Nov 2, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot temporarily deployed to storybook-preview-4481 November 5, 2024 13:54 Inactive
@lesliecdubs
Copy link
Member

👋🏻 @TylerJDev just checking in here, as I see this one has been open for a while. What's the remaining effort to get this over the line? Is this likely to be a MAS C* blocker?

@TylerJDev
Copy link
Contributor Author

Hey @lesliecdubs! The effort remaining is small. I paused on this temporarily, but should have enough capacity to get this through. I don't believe it will be a MAS*C blocker, but is definitely an improvement for usability & accessibility.

@TylerJDev TylerJDev requested a review from siddharthkp November 7, 2024 14:07
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 6, 2025
@TylerJDev TylerJDev removed the Stale label Jan 6, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-4481 January 8, 2025 15:49 Inactive
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/357125

@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jan 9, 2025
@siddharthkp siddharthkp removed their request for review January 9, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: failing Changes in this PR cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants