Skip to content

Error with RouterService.isActive with Query Parameters #17423

Open
@rtablada

Description

@rtablada

When working with the RouterService's isActive method default query params and non-included query params are not accounted for properly.
As a user the expected behavior would be that isActive matches the active state of link-to.

This can be seen in this twiddle:

https://ember-twiddle.com/bad1dd32c81f9c4d93864cd0a59e19ac/77a1ab275385a99cdf156bf90704abed2e144c72?openFiles=controllers.application.js%2C

From digging into (and trying to modify tests in the Ember source) it looks like there is a false positive in the tests because of the way that locationType: 'none' handles QP default values.

In our application I'm able to get isActive to return true if locationType is set to none, but when using hash or history the value of isActive does not work for default values or if there are other QPs which are set to default.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions