Skip to content

fix(select): guard against null ref in typeahead focus#3820

Open
Tourniercy wants to merge 1 commit into
radix-ui:mainfrom
Tourniercy:fix/select-typeahead-focus-null-ref
Open

fix(select): guard against null ref in typeahead focus#3820
Tourniercy wants to merge 1 commit into
radix-ui:mainfrom
Tourniercy:fix/select-typeahead-focus-null-ref

Conversation

@Tourniercy
Copy link
Copy Markdown

Description

Fixes #3597

Adds a null check on nextItem.ref.current before calling .focus() in the typeahead search handler within SelectContentImpl.

When using the Select component on mobile browsers (observed on Android Chrome), the DOM element referenced by nextItem.ref.current can be null if the element hasn't mounted yet or has been unmounted due to timing issues.

This causes an unhandled TypeError: Cannot read properties of null (reading 'focus').

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 25, 2026

⚠️ No Changeset found

Latest commit: 1299a55

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error Cannot read properties of null (reading 'focus') - radix select

1 participant