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
- Go to sandobx,
- 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'
}
}
}
});