Commit 01ecdaa
vvo
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 :)1 parent 20fc4aa commit 01ecdaa
File tree
3 files changed
+8
-13
lines changed- src/lib
- __tests__
3 files changed
+8
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | 108 | | |
111 | | - | |
| 109 | + | |
112 | 110 | | |
113 | 111 | | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 135 | | |
142 | 136 | | |
143 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | 180 | | |
183 | 181 | | |
184 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
0 commit comments