Skip to content

Conversation

@TylerJDev
Copy link
Member

@TylerJDev TylerJDev commented Nov 24, 2025

Resolves issues in:

Adds the following:

⚠️ This also includes a bump to @primer/behaviors to 1.9.0.

Changelog

New

  • Adds props setInitialFocus and disableSelectOnHover

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2025

🦋 Changeset detected

Latest commit: ff00f6d

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 Minor

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

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 24, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7240 December 5, 2025 16:59 Abandoned
@TylerJDev TylerJDev changed the title Add setting to disable selection on hover FilteredActionList: Add opt-in props to give more flexibility on focus management with aria-activedescendant Dec 5, 2025
@TylerJDev TylerJDev marked this pull request as ready for review December 5, 2025 17:03
@TylerJDev TylerJDev requested a review from a team as a code owner December 5, 2025 17:03
@github-actions github-actions bot requested a deployment to storybook-preview-7240 December 5, 2025 17:04 Abandoned
Copilot finished reviewing on behalf of TylerJDev December 5, 2025 17:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds two new opt-in props to FilteredActionList (and by extension SelectPanel) to provide more flexibility in managing focus behavior with aria-activedescendant. The changes address accessibility issues and improve control over hover-based selection. The PR also bumps @primer/behaviors to version 1.9.0, which enables these new focus management features.

Key changes:

  • Adds disableSelectOnHover prop to disable automatic selection on mouse hover
  • Adds setInitialFocus prop to control initial focus behavior when the component becomes active
  • Updates @primer/behaviors dependency from 1.8.2 to 1.9.0

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/react/src/FilteredActionList/FilteredActionList.tsx Implements the two new props (disableSelectOnHover and setInitialFocus) with corresponding focus zone configuration options and data attributes for items
packages/react/src/SelectPanel/SelectPanel.tsx Adds disableSelectOnHover to SelectPanelBaseProps and passes it through to FilteredActionList
packages/react/src/SelectPanel/SelectPanel.dev.stories.tsx Adds two new story examples demonstrating the usage of both new props
packages/react/package.json Updates @primer/behaviors dependency to version 1.9.0
package-lock.json Updates lock file entries for @primer/behaviors version 1.9.0
.changeset/many-planets-take.md Documents the addition of disableSelectOnHover prop
.changeset/chubby-wombats-start.md Documents the addition of setInitialFocus prop
Comments suppressed due to low confidence (2)

packages/react/src/FilteredActionList/FilteredActionList.tsx:347

  • The data attribute naming is confusing. data-select-on-hover="true" when disableSelectOnHover is true suggests that selection on hover is enabled, when it's actually disabled. Consider either:
  1. Renaming to data-disable-select-on-hover to match the prop name
  2. Inverting the logic: data-select-on-hover={!disableSelectOnHover ? 'true' : 'false'}
  3. Or simply: data-select-on-hover={String(!disableSelectOnHover)}
                        {...item}

packages/react/src/FilteredActionList/FilteredActionList.tsx:364

  • The data attribute naming is confusing. data-select-on-hover="true" when disableSelectOnHover is true suggests that selection on hover is enabled, when it's actually disabled. Consider either:
  1. Renaming to data-disable-select-on-hover to match the prop name
  2. Inverting the logic: data-select-on-hover={!disableSelectOnHover ? 'true' : 'false'}
  3. Or simply: data-select-on-hover={String(!disableSelectOnHover)}
                  renderItem={listProps.renderItem}

@github-actions github-actions bot requested a deployment to storybook-preview-7240 December 5, 2025 17:35 Abandoned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants