Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rootpath): remember rootpath option on 'back' button
Before this commit, when using the rootpath option and clicking on backbutton after switching a page would result in the rootpath option seeming "forgotten" This was triggered because rootpath is a "magical" (BAD!!) option that is triggering a refinement internally in the helper's SearchParameters constructor. Thus, in the urlSync widget, to determine the "original configuration" (= all widgets getConfiguration before url sync) we need to go through the SearchParameters constructor. Also note that we originally wanted to understand the url sync "original config" as being widget's getConfiguration + widget's init but that's no doable because the way we implemented url sync. Indeed there's no way to differentiate the state of the url from the state of the widget's init action after all widget.init are called. Thus when clicking back, we are not able to tell what are the parameters we want to go back to. In a V2 of instantsearch.js we should be able to have init({helper, state, urlState}). Or maybe there's another way. I will need to discuss this with @bobylito :)
- Loading branch information