We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7875e9 commit 7e639d6Copy full SHA for 7e639d6
src/lib/InstantSearch.js
@@ -193,10 +193,16 @@ Usage: instantsearch({
193
}
194
});
195
196
- // no need to trigger a search if we don't have any widgets left
197
- if (this.widgets.length > 0) {
198
- this.helper.search();
199
- }
+ // If there's multiple call to `removeWidget()` let's wait until they are all made
+ // and then check for widgets.length & make a search on next tick
+ //
+ // This solves an issue where you unmount a page and removing widget by widget
200
+ setTimeout(() => {
201
+ // no need to trigger a search if we don't have any widgets left
202
+ if (this.widgets.length > 0) {
203
+ this.helper.search();
204
+ }
205
+ }, 0);
206
207
208
/**
0 commit comments