Open DimplocetY opened 2 years ago
I can't reproduce this in our sample, https://codesandbox.io/s/github/algolia/create-instantsearch-app/tree/templates/angular-instantsearch?file=/src/app/app.component.html, could you edit it to show the issue you're having?
I also was not able to reproduce the issue in the sample. As our project is a Sap spartacus one, the issue seems to be caused by the changeDetectionStrategy. We were able to solve the issue by adding a changeDetectionRef.detectChanges() on the (change) of the ais-instantsearch. However now we are trying to convert the project to use one global ais-instantsearch tag instead of one per component. In doing this our previous change stops working and the issue returns.
I am currently doing an implementation of Algolia in an angular project. And created a component as below:
When initially searching everything is working fine, but when I try to sort or change the page I have to change/click twice before the hits list updates. I also tried to use the onStateChange, but the setUiState() method does not seem to work.
onStateChange({ uiState, setUiState }: any) { console.log(uiState); setUiState(uiState); },
Here the uiState seems to be correct (what it should be after the change). We are on following version:"angular-instantsearch": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/angular-instantsearch/-/angular-instantsearch-4.1.0.tgz", "integrity": "XXX", "requires": { "instantsearch.css": "^7.3.1", "instantsearch.js": "^4.31.1", "nouislider": "^10.0.0", "querystring-es3": "^0.2.1", "tslib": "^2.1.0" } },