Skip to content
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

replaceRoute in setup sends incorrect event to queryParamsDidChange #61

Open
km-smith opened this issue Aug 15, 2018 · 0 comments
Open

Comments

@km-smith
Copy link

Ran into a weird bug when you call replaceRoute and only change query params for the current route inside the setup method. What happens is the setup method runs and the query params are changed. The subsequent call ember parachute makes to queryParamsDidChange seems to contain the original(not updated) values in queryParams but includes any updated query params in changed. This cause some weird issues with my logic which was relying on changed.

Assume we have query params foo and bar and they default to empty strings. First hit the route and setup is called where the queryParams are { foo: '', bar: '' }. Then use replaceRoute in setup and set them to { foo: 'foo', bar: 'bar' }. When queryParamsDidChange is called its queryParams will be { foo: '', bar: '' }. but its changed will be { foo: 'foo', bar: 'bar' }. Let me know if you need a full reproduction and I can toss one together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant