emberjs / emberjs/ember.js

Resetting query parameter does not work as expected

Open
#15,799 2 comments 1 reaction 0 assignees View on GitHub
Has Reproduction Query Params Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

Example project that reproduces it can be found in https://github.com/vmalloc/ember-route-bug-reproduce.

Essentially what happens is if a controller has an observer function on a query param change that resets a second parameter as a response (e.g. resetting the page number when the search term changes) - the second parameter does not get reset when the change is triggered as a result of pressing a link.

In the example the route `/#/items` by default contains no `search` value, and the `page` parameter can be incremented. Then the user clicks the link leading to the same route but with a different `search` value, and the page remains the same...

Moreover, the page segment of the route URL *does* get eliminated *as if* the value returned to its default, but it does not...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.