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

UI-router uiOnParamsChanged event is not triggered when StickyStatesPlugin is enabled #16

Closed
nazar-kuzo opened this issue Sep 6, 2017 · 3 comments

Comments

@nazar-kuzo
Copy link

nazar-kuzo commented Sep 6, 2017

@christopherthielen,

I use uiOnParamsChanged event for catching dynamic state parameter change, but when I enable StickyStatesPlugin it stop propagation. Spend some time drilling down issue and definitely lives under "_calculateStickyTreeChanges" method as a part of "_addCreateHook" hook.

Seems like this line var shouldRewritePaths = ['entering', 'exiting'].some(function (path) { return !!simulatedTC[path].length; }); sais that it needs to overwrite path and in the same time reverts state params changes that supposed to trigger "uiOnParamsChanged" event in future.

Reproduced on:
"uirouter/core": "5.0.3",
"uirouter/angularjs": "1.0.3",
"uirouter/sticky-states": "1.4.1",

Please notice, this plugin will not work (application crashes, webpack build crashes) with upper version of "uirouter/core" or "uirouter/angularjs"

Thanks for your help!

@jnfeinstein
Copy link

I think I'm experiencing the same issue. I have states that use reloadOnSearch: false. The onSuccess transition event would be fired when a query param changed, even if the state didn't change. With this plugin installed the event is no longer thrown. This is actually critical since ui-sref depends on this hook to update, which means query param inheritance is broken.

@jnfeinstein
Copy link

@nazar-kuzo confirmed that I'm experiencing the same issue you are. The line you pointed to is the culprit.

@christopherthielen
Copy link
Member

@nazar-kuzo i merged a commit to @uirouter/core that should fix this in the next release of uirouter/angularjs.

I'd like to understand the problem you had building this with webpack. Can you elaborate (please create a new issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants