Aborting a transition with queryParams still triggers fireQueryParamDidChange
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
In Ember 3.20.1, I’m running into an issue when aborting a transition that has `queryParams`. Even though the transition is aborted, if the `queryParams` are watched by the target route, the current route is refreshed with the `queryParams` of the new transition. The issue seems to be related to https://github.com/emberjs/ember.js/issues/18683, although in my case I think there is simple solution. The root cause seems to be in `getTransitionByIntent` of `router_js/transition`. https://github.com/tildeio/router.js/blob/bedbf4e2c6a544bc8a678d286d00b412d0ebab51/lib/router/router.ts#L272
```
if (!wasTransitioning) {
this.notifyExistingHandlers(newState, newTransition); // triggers willTransition hook that holds the transition.abort() call
}
this.fireQueryParamDidChange(newState, queryParamChangelist!); // not aware that the transition has been aborted
```
Would it be possible to wrap the fireQueryParamDidChange call in a check if (!newTransition.isAborted) ?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.