Skip to content

fix(autocomplete): forward the root ref#6922

Merged
FabienMotte merged 1 commit intomasterfrom
fix/autocomplete-root-ref
Mar 12, 2026
Merged

fix(autocomplete): forward the root ref#6922
FabienMotte merged 1 commit intomasterfrom
fix/autocomplete-root-ref

Conversation

@FabienMotte
Copy link
Contributor

Summary

On the dashboard, React shows a warning when rendering InnerAutocomplete that function components cannot be given refs. Because the autocomplete root ref is not attached to the DOM node, focusing the autocomplete input opens the panel briefly and closes it right after. This change fixes the root ref wiring while keeping the existing getRootProps() API intact.

Result

  • Click the autocomplete input and confirm the panel stays open on first focus.
  • Confirm the React warning about passing refs to function components no longer appears.

@FabienMotte FabienMotte force-pushed the fix/autocomplete-root-ref branch from 0512381 to ce6c640 Compare March 12, 2026 16:44
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ce6c640:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@FabienMotte FabienMotte marked this pull request as ready for review March 12, 2026 16:57
@FabienMotte FabienMotte requested review from a team, aymeric-giraudet and shaejaz and removed request for a team March 12, 2026 16:57
@FabienMotte FabienMotte merged commit a7f62d8 into master Mar 12, 2026
14 checks passed
@FabienMotte FabienMotte deleted the fix/autocomplete-root-ref branch March 12, 2026 17:58
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.

3 participants