Skip to content

Conversation

@TylerJDev
Copy link
Member

@TylerJDev TylerJDev commented Jan 9, 2026

Part of https://github.com/github/primer/issues/6299

  • Bumps @primer/behaviors to v1.10.0.
  • Adds new prop scrollBehavior to FilteredActionList, allow consumers to adjust the scroll behavior (auto | instant | smooth)

Changelog

New

  • Adds prop scrollBehavior to FilteredActionList

Changed

  • Bumps @primer/behaviors to v1.10.0

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 Jan 9, 2026

🦋 Changeset detected

Latest commit: f1d6be8

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 Jan 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

👋 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.

@TylerJDev TylerJDev changed the title Behaviors Bump Test Bump behaviors to v1.10.1; adds new prop to FilteredActionList Jan 14, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7436 January 14, 2026 18:18 Inactive
@primer-integration
Copy link

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

@TylerJDev TylerJDev marked this pull request as ready for review January 14, 2026 18:39
@TylerJDev TylerJDev requested a review from a team as a code owner January 14, 2026 18:39
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 bumps the @primer/behaviors package from v1.9.1 to v1.10.0 and adds a new scrollBehavior prop to the FilteredActionList component. This prop allows consumers to customize the scroll animation behavior when items receive focus, with options like 'auto', 'instant', or 'smooth'.

Changes:

  • Updated @primer/behaviors dependency from v1.9.1 to v1.10.0
  • Added scrollBehavior prop to FilteredActionList component with type ScrollBehavior
  • Applied scrollBehavior to scrollIntoView calls within the focus zone and effects
  • Modified the condition for scrolling to also consider focusPrependedElements

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/react/src/FilteredActionList/FilteredActionList.tsx Added scrollBehavior prop definition, parameter destructuring, and usage in scrollIntoView calls; modified scroll trigger condition
packages/react/package.json Bumped @primer/behaviors from ^1.9.1 to ^1.10.0
package-lock.json Updated dependency version references for @primer/behaviors and @primer/react
.changeset/slow-seas-design.md Added changeset documenting the new scrollBehavior prop
Comments suppressed due to low confidence (1)

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

  • The useFocusZone dependency array is missing scrollBehavior. Since scrollBehavior is used inside the onActiveDescendantChanged callback, it should be included in the dependency array to ensure the callback is recreated when scrollBehavior changes. Additionally, other dependencies like inputRef and scrollContainerRef that are also used in the callback are missing from the dependency array.
  useFocusZone(
    !usingRovingTabindex
      ? {
          containerRef: {current: listContainerElement},
          bindKeys: FocusKeys.ArrowVertical | FocusKeys.PageUpDown,
          focusOutBehavior,
          focusableElementFilter: element => {
            return !(element instanceof HTMLInputElement)
          },
          activeDescendantFocus: inputRef,
          onActiveDescendantChanged: (current, previous, directlyActivated) => {
            activeDescendantRef.current = current
            if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) {
              scrollIntoView(current, scrollContainerRef.current, {
                ...menuScrollMargins,
                behavior: scrollBehavior,
              })
            }

            onActiveDescendantChanged?.(current, previous, directlyActivated)
          },
          focusInStrategy: setInitialFocus ? 'initial' : 'previous',
          ignoreHoverEvents: disableSelectOnHover,
          focusPrependedElements,
        }
      : undefined,
    [listContainerElement, usingRovingTabindex, onActiveDescendantChanged, focusPrependedElements],
  )

*
* @default 'auto'
*/
scrollBehavior?: ScrollBehavior
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The scrollBehavior prop lacks an explicit type import. While ScrollBehavior appears to be a built-in DOM type, it would be clearer to either import it from @primer/behaviors (if it's exported there) or use a union type like 'auto' | 'instant' | 'smooth' to match the documented options in the JSDoc comment.

Suggested change
scrollBehavior?: ScrollBehavior
scrollBehavior?: 'auto' | 'instant' | 'smooth'

Copilot uses AI. Check for mistakes.
activeDescendantRef.current = current
if (current && scrollContainerRef.current && directlyActivated) {
scrollIntoView(current, scrollContainerRef.current, menuScrollMargins)
if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) {
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The condition for triggering scroll has been changed from directlyActivated to (directlyActivated || focusPrependedElements). This behavioral change is not documented in the PR description or changeset, and it's unclear if this is intentional or a side effect. If this is an intentional fix, it should be documented separately. If it's related to the scrollBehavior feature, the relationship should be explained.

Suggested change
if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) {
if (current && scrollContainerRef.current && directlyActivated) {

Copilot uses AI. Check for mistakes.
"@lit-labs/react": "1.2.1",
"@oddbird/popover-polyfill": "^0.5.2",
"@primer/behaviors": "^1.9.1",
"@primer/behaviors": "^1.10.0",
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The PR title states 'Bump behaviors to v1.10.1' but the package.json shows v1.10.0. This is a mismatch between the title and the actual version being bumped to.

Suggested change
"@primer/behaviors": "^1.10.0",
"@primer/behaviors": "^1.10.1",

Copilot uses AI. Check for mistakes.
@primer-integration
Copy link

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

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.

2 participants