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

When resolving an onBefore promise, the previous state is removed while async resolves are still pending. #3827

Open
1 task done
robertvanhoesel opened this issue Mar 24, 2021 · 1 comment
Labels

Comments

@robertvanhoesel
Copy link

robertvanhoesel commented Mar 24, 2021

This is a (check one box):

  • Bug Report

My version of UI-Router is: 1.0.28

Bug Report

Current Behavior:

We can return a promise to transitions.onBefore(), if the promises resolves, I observe that the router starts the exit/retain/enter flow, and in turn removes the original state from the DOM.

The new state is only added after all async resolves are completed. In the mean time this leaves an empty dom or 'flickering' page.

Expected Behavior:

I expect the behavior to be the same to when I am not using an async onBefore, which is: Don't exit the original state until all async resolves are completed.

When returning a promise transitions.onEnter() the behavior is as expected. I can work with that.

If you think I am on to something here I am happy to provide a repro – otherwise feel free to ignore. Thanks for maintaining this useful project!

@stale
Copy link

stale bot commented Apr 18, 2022

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues
may be reopened.

Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant