ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Error with RouterService.isActive with Query Parameters

Open rtablada opened this issue 6 years ago • 9 comments

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.

rtablada avatar Jan 04 '19 00:01 rtablada