Issue with compose element and composition
- Dominant language
- TypeScript
- Stars
- 11.7k
- Forks
- 608
- PR merge metrics
- No merged PRs in 30d
Description
If you use a compose element (who's activate function returns a promise) within a ViewModel, the router complete event seems to fire before the promise is resolved which causes a jumpiness in the navigation. If we remove the compose element from the view model everything works fine.
Is this behavior intended? Shouldn't the router wait for the entire view to compose include any composed elements ( before considering navigation complete?
The process looks like this:
- Navigate from page A to Page B
- Router.IsNavigating = true
- Router.IsNavigating = false (at this point page A still shows as Page B hasn't fully been composed)
- Page B is fully composed and shown.
Contributor guide
Research direction
Trace the router's complete event and the element's activation path, especially when a ViewModel activate function returns a promise. Reproduce the A-to-B navigation sequence described in the issue and inspect when IsNavigating changes. Done means router completion waits until nested composition finishes and the navigation jumpiness is gone, with coverage for this sequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100