Skip to content

feat(autocomplete): noResults template#6917

Merged
aymeric-giraudet merged 2 commits intomasterfrom
feat/autocomplete-no-results
Mar 11, 2026
Merged

feat(autocomplete): noResults template#6917
aymeric-giraudet merged 2 commits intomasterfrom
feat/autocomplete-no-results

Conversation

@aymeric-giraudet
Copy link
Member

@aymeric-giraudet aymeric-giraudet commented Mar 9, 2026

Summary

FX-3580

  • Add noResults template/component per autocomplete index, rendered when hits are empty
  • Auto-hide panel when all content sources (indices, recent searches) are empty and no noResults templates exist

Result

  • Lint, build, bundlesize, tests all pass

@aymeric-giraudet aymeric-giraudet requested review from a team, FabienMotte and shaejaz and removed request for a team March 9, 2026 10:46
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 9, 2026

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 b91aeee:

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

<AutocompletePanel {...getPanelProps()}>
<AutocompletePanel
{...getPanelProps()}
{...(shouldHideEmptyPanel ? { hidden: true } : {})}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this not be done in the getPanelProps? Would passing the indicesForPanel not be ideal?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just passed shouldHideEmptyPanel, looks a bit cleaner

@aymeric-giraudet aymeric-giraudet merged commit a59db2f into master Mar 11, 2026
14 checks passed
@aymeric-giraudet aymeric-giraudet deleted the feat/autocomplete-no-results branch March 11, 2026 10:33
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