-
Notifications
You must be signed in to change notification settings - Fork 66
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 Parameter Changes that occur simultaneously with path changes not propagated at the same time #149
Comments
I was wrong about the root cause of this issue. The real culprit is iron location which has a method:-
The very fact that A solution might be to change the order of these two settings - although this would then propagate the queryParams change, which might be less problematic, but still wrong. I wonder if the problem is a design one - that of having the layering of |
Sadly I have come to the conclusion that its a design issue that isn't going to go away. I have ended up making my own pair of elements |
I'm having a problem getting correct query-params values behavior from nested app-routes... This works fine:
In my case, the 2nd route element is in a composed child element...
In the broken case, queryParams ends up being a stale value... If I modify the overall structure such that the |
Run into the same issue. The url is only changed 1 time, but route-changed is fired 2 times. (Haven't took a look at it, but most likely because these are the default notify events, and |
This PR might be interesting: PolymerElements/iron-location#86 |
Description
When a url changes such that there is a path change and a change of query-parameters, the path, without the query parameters gets propagated around the
app-route
network of elements and then in a second phase the updated query-params get propagated.The net result is a observer function looking at changes to the route, doesn't see the correct query parameters when running with the change.
The cause is
__computeRoutePath
inapp-location
, since it starts a propagation sequence that doesn't include the simultaneous change to the query params..Expected outcome
As the
route
changes it should already have the query parameters in the route.Actual outcome
The change is propagated with the previous value of query parameters, so any functions expecting to see the query parameters don't see them
Live Demo
github repository akc42/app-route has a branch query-param-order with a test case that shows this problem. Unfortunately my proposed solution (to debounce
_locationChanged
inapp-route-converter
breaks lots of other tests so isn't the right oneSteps to reproduce
see test case
test-query-order.html
and the associated test elementapp-example-2.html
Browsers Affected
Not tested the rest
The text was updated successfully, but these errors were encountered: