-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route queryParams replace does not work if refreshModel is true #11843
Comments
will reopen if it is demonstrated to not be a duplicate |
No it is not duplicate. I opened another one some time ago: #10972 which is a duplicate, but this one is independent. App.ArtistSongsRoute = Ember.Route.extend({
queryParams: [
qp: {
refreshModel: true,
replace: true
}
]
.... This should result in, AFAIU, that if the model is refreshed several times with different 'qp', the browser history will only hold one reference on this route url. So, let's say the user searches for an artist: http://emberjs.jsbin.com/zawiwe enter '1' in the input and submit, then '2' and submit, then '3' and submit. Now if you click 'back' browser button you will work through &qp=2 and &qp=1 history. On the other hand, if you use 'Send with replace query params', this works as expected, no history is pushed |
@stefanpenner, is my explanation clear? Do you think it is not duplicate issue? |
I'm experiencing this on Ember 2.2 as well. @novtor what do you mean by "send with replace query params"? Looking for a workaround. |
hi @richmolj , see the jsbin example |
This is a duplicate of #10577 ?? |
@novtor can you provide an updated example (reproduction of the issue) using a current release of Ember.js or the LTS release (2.4.6) ? |
@novtor I created a current example using ember-twiddle, see I set the |
@emberjs/issues-team @emberjs/learning-team-managers according to the docs The example is to either use I'm curious if this is a documentation issue or a bug. Assuming you could use: queryParams:{
a: {
refreshModel: true,
replace: true
}
},
model: function(params) {
return ['red-'+params.a, 'yellow', 'blue'];
} … and not introduce new history to the browser, this would be a bug. However in Ember the URL is intended to represent the state of the app and a refresh of the model (even in combination of the query param) is a different state of the application. Which would indicate that using both |
Almost certainly same as #10577 as @Panman8201 points out. As @pixelhandler points out, the guides never use these two configuration options together in the same example. When I teach queryParams I also use a separate example for each config option because of this limitation/bug. It would be a big help to know which of the following situations this issue falls into
Happy to pull some weight on this once we know what we're looking at. |
@pixelhandler @machty @mike-north @alexspeller is there any update on this issue ? I wonder if tildeio/router.js#198 will fix this ? |
This was fixed by #15148, thanks folks! |
For a route with queryParams, replace does not work if refreshModel is set to true:
http://jsbin.com/jebuko/edit?html,js,output
Open jsbin as live preview, enter something in input field, submit the input, it will modify query parameter 'a' and refresh the template. Do it several times. Then 'back' button will pass trough all the submit history.
Is it expected or I do something wrong?
The text was updated successfully, but these errors were encountered: