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

Query-params only Link-Tos do not update anymore when route/url change #11533

Closed
juggy opened this issue Jun 22, 2015 · 6 comments
Closed

Query-params only Link-Tos do not update anymore when route/url change #11533

juggy opened this issue Jun 22, 2015 · 6 comments

Comments

@juggy
Copy link
Contributor

juggy commented Jun 22, 2015

Please consider http://output.jsbin.com/vexeho#/no-model

You will see that if you change the route from "no-model" to "model" the 2 query-params route will not refresh to show the new route (it will still have a href with /no-model?a=).

In the previous version of Ember, it would update based on the current page/url.

@jmurphyau
Copy link
Contributor

Can you provide a JSBin with an older version where you demonstrate this working?

I can see the 'a' query param is set on the ApplicationController - which is always active.. Seems like normal behaviour having a=[something] for each route.

@juggy
Copy link
Contributor Author

juggy commented Jun 23, 2015

Here a version with 1.10 http://output.jsbin.com/dixigo

You will see that the first link (params 1) href will update when you move from route to route (by clicking the bottom 2 links).

This is not the case with the version using ember 1.13: http://output.jsbin.com/vexeho

@juggy
Copy link
Contributor Author

juggy commented Jun 25, 2015

Update bins:
canary: http://jsbin.com/vexeho/9/edit?html,js,output
with PR #11535 : http://jsbin.com/jutako/4/edit?html,js,output

You should compare against working 1.10 version:
1.10: http://jsbin.com/dixigo/3/edit?html,js,output

Thanks

@juggy
Copy link
Contributor Author

juggy commented Jun 26, 2015

@jmurphyau are you familiar with the code behind this? I would try to fix this, but I do not know where to start...

@jmurphyau
Copy link
Contributor

The targetRouteName of the LinkComponent isn't getting updated when _routing.currentState changes..

In 1.10, there is logic between:

if (onlyQueryParamsSupplied) {
...
else
...
}

That runs every time the URL changes - in 1.13 this gets run on willRender which is only run once...

I'm wondering if willRender is meant to be triggered, or if the solution is to call this.rerender()? Or is the solution just to fix targetRouteName not being tracked correctly on route changes? It feels to me like the component should be rerendered and willRender called (which looks like it would solve this problem)

@rwjblue
Copy link
Member

rwjblue commented Jul 1, 2015

Fixed by #11561.

@rwjblue rwjblue closed this as completed Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants