-
Notifications
You must be signed in to change notification settings - Fork 650
Bump behaviors to v1.10.1; adds new prop to FilteredActionList #7436
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f1d6be8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
👋 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 |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/10704 |
There was a problem hiding this 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/behaviorsdependency from v1.9.1 to v1.10.0 - Added
scrollBehaviorprop toFilteredActionListcomponent with typeScrollBehavior - Applied
scrollBehaviortoscrollIntoViewcalls 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
useFocusZonedependency array is missingscrollBehavior. SincescrollBehavioris used inside theonActiveDescendantChangedcallback, it should be included in the dependency array to ensure the callback is recreated whenscrollBehaviorchanges. Additionally, other dependencies likeinputRefandscrollContainerRefthat 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 |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
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.
| scrollBehavior?: ScrollBehavior | |
| scrollBehavior?: 'auto' | 'instant' | 'smooth' |
| activeDescendantRef.current = current | ||
| if (current && scrollContainerRef.current && directlyActivated) { | ||
| scrollIntoView(current, scrollContainerRef.current, menuScrollMargins) | ||
| if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) { |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
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.
| if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) { | |
| if (current && scrollContainerRef.current && directlyActivated) { |
| "@lit-labs/react": "1.2.1", | ||
| "@oddbird/popover-polyfill": "^0.5.2", | ||
| "@primer/behaviors": "^1.9.1", | ||
| "@primer/behaviors": "^1.10.0", |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
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.
| "@primer/behaviors": "^1.10.0", | |
| "@primer/behaviors": "^1.10.1", |
Part of https://github.com/github/primer/issues/6299
scrollBehaviortoFilteredActionList, allow consumers to adjust the scroll behavior (auto|instant|smooth)Changelog
New
scrollBehaviortoFilteredActionListChanged
Rollout strategy
Testing & Reviewing
Merge checklist