add selectOnFocus prop to allow disabling selection on focus#9415
Open
romansndlr wants to merge 2 commits intoadobe:mainfrom
Open
add selectOnFocus prop to allow disabling selection on focus#9415romansndlr wants to merge 2 commits intoadobe:mainfrom
romansndlr wants to merge 2 commits intoadobe:mainfrom
Conversation
Contributor
Author
|
Would love your review on this one please 🙏🏻 |
Member
|
Thanks for the PR, the team is currently on holiday. We'll review when we are back in the new year. |
snowystinger
reviewed
Jan 7, 2026
Member
snowystinger
left a comment
There was a problem hiding this comment.
Would just using 'Option + Arrow Down/Up' to navigate via keyboard without selecting on focus work for you without needing these changes? Selection is pretty complex, so it'd be better if we didn't need to add another option.
| linkBehavior?: 'action' | 'selection' | 'override', | ||
| /** | ||
| * Whether selection should occur automatically on focus. | ||
| * @default true (when selectionBehavior is 'replace') |
Member
There was a problem hiding this comment.
should this be disregarded if selectionBehaviour is not replace?
| it('should not select on focus when selectOnFocus={false} with multiple selection', async () => { | ||
| let onSelectionChange = jest.fn(); | ||
| let {getAllByRole} = render( | ||
| <GridList aria-label="Test" selectionMode="multiple" selectionBehavior="replace" selectOnFocus={false} onSelectionChange={onSelectionChange}> |
Member
There was a problem hiding this comment.
how does one select multiple in replace? does shift+arrow down work?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
We want to allow a user to browse the list using their keyboard without "persisting" the selection.
This is consistent with many implementations out in the wild:
✅ Pull Request Checklist:
📝 Test Instructions:
selectionBehavior="replace"andselectionMode="multiple"selectOnFocus={false}to the GridList