-
-
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
[Bug] Default queryParams are not getting pruned #19492
Comments
Was this behaving differently in an older version of Ember? I was under the impression that this is intended behaviour when using Edit: See #19492 (comment) |
@bertdeblock It also happens in 3.14. Reading the RFC you are correct. Its terrible DX. How is it ok to have different behaviors when transitioning to a route? 🤯 |
@mmpestorich I'm not sure I completely understand how this is related to the reported issue. Having to use an existing array vs using a new array => If my default QP value is Edit: See #19492 (comment) |
@bertdeblock I see, you're right my original analysis there is off. I didn't notice the comparison noted above is between the default and current serialized values of the query param. In which, case they should be equal strings and qp should be pruned. Sorry about that. |
Actually, after discussing this with a friend, I think that I have misinterpreted that RFC section. I was under the impression that all default QP values would end up in the URL, so not only the default values of the specified QP's via the |
Thanks for your input @bertdeblock. The RFC certainly makes it sounds as if this is the intended behavior 🤷🏾♂️ . |
🐞 Describe the Bug
Transitioning to from a parent route with queryParams to a child route with queryParams using the router service, fails to prune default queryParams leaving the URL in an undesired state
🔬 Minimal Reproduction
https://github.com/lvegerano/ember-qp-prune-fail
😕 Actual Behavior
Having the following routes:
main
has a queryParamsrouting to
main.route-a
using the router service adds the serialized array brackets toroute-a
URLhttp://localhost:4200/main/route-a?l=%5B%5D
🤔 Expected Behavior
The URL does not contain the default value of the queryParam
http://localhost:4200/main/route-a
🌍 Environment
The text was updated successfully, but these errors were encountered: