algolia / instantsearch

⚑️ Libraries for building performant and instant search experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.

Home Page:https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attribute widget is not displays active filter when use the filters config

bilalmalkoc opened this issue Β· comments

πŸ› Current behavior

When set the a filter with configure widget, current filters not displaying as active.

I set brand:Apple filter here:

instantsearch.widgets.configure({
  hitsPerPage: 8,
  filters: 'brand:Apple',
}),

πŸ” Steps to reproduce

  1. Go to sandobx,
  2. Check the menu widget.

Live reproduction

https://codesandbox.io/s/ecstatic-lovelace-hfqwqw?file=/src/app.js:641-730

πŸ’­ Expected behavior

In the menu widget, Apple brand must be selected because i set this attribute from config widget.

Package version

instantsearch.js 4.57.0

Operating system

macOS 14.0

Browser

Google Chrome 117.0.5938.149

Code of Conduct

  • I agree to follow this project's Code of Conduct

Hi, the configure widget does not apply search parameters to the UI. If you want to have a refined UI, you need to additionally set initialUiState in instantsearch(), like this:

const search = instantsearch({
  // ...
  initialUiState: {
    instant_search: {
      menu: {
        brand: 'Apple'
      }
    }
  }
});