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

Failing test to demonstrate query params bug #16986

Closed
wants to merge 1 commit into from

Conversation

rlivsey
Copy link
Contributor

@rlivsey rlivsey commented Sep 18, 2018

If there's:

  1. a dynamic segment
  2. a loading template
  3. a route with a model hook that returns a promise
  4. a query param defined

then the query param is not sticky on link-tos

Possibly related to #12107

Twiddle demonstrating the issue: https://ember-twiddle.com/97f2c3d7596c97d51846033ad23d75f2

If there's:

1. a dynamic segment
2. a loading template
3. a route with a model hook that returns a promise
4. a query param defined

then the query param is not sticky on link-tos

Possibly related to emberjs#12107
@lifeart
Copy link
Contributor

lifeart commented Sep 24, 2018

Maybe it's related bug - #14438

@rlivsey
Copy link
Contributor Author

rlivsey commented Sep 25, 2018

@lifeart ooh interesting, yes the conditions to trigger the bug do appear to be suspiciously similar

@lolmaus
Copy link
Contributor

lolmaus commented Feb 4, 2019

Hi! I'm the author of #14438, which was from 2016.

I've just ran into the issue described here, and my setup is much simpler than in #14438. We have a single query param in the whole app, some dynamic segments and no loading routes.

The query param is defined on a parent controller foo with a default value. When I go from foo.bar.index to foo.bar.baz and back (I don't even touch the query param property!), the URL is updated with explicit query param value, and the active class on the corresponding link-to is lost.

@lolmaus
Copy link
Contributor

lolmaus commented Feb 4, 2019

Hmm, in our case we make the via an action. Not sure if it matters.

@rreckonerr
Copy link
Contributor

I just checked if tildeio/router.js#308 fixes your test case and it seems to work! Can someone else confirm it too?

@rwjblue
Copy link
Member

rwjblue commented Nov 6, 2020

Included (and fixed) in #19249, thanks again @rlivsey!

@rwjblue rwjblue closed this Nov 6, 2020
kategengler pushed a commit that referenced this pull request Nov 9, 2020
Refs: Based off reproduction in #16986
(cherry picked from commit c8cc545)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants