When calling this.app.router.redirectTo('some/path') from the client, the rendering order of views in a parent-child view hierarchy is often not correct.
This is happening because in _postRender we call attachChildViews and then immediately trigger the postRender event, without waiting for attachChildViews itself to be completed.
In AMD environment, this often results in child views firing postRender before parent views, or in random order anyway.
The solution is as simple as firing postRender only when the child views are attached, using a callback for it.
Please let me know if this is not clear.
What do you think?
Coverage increased (+0.01%) to 84.52% when pulling e95f4300a889e321bbfc20e4a55fa5de65105f34 on ingiulio:attachChildViewsOrderOnClientSide into 2b07b947f98a9d2d57ee1be98bc7d6e578fa5c01 on rendrjs:master.
When calling
this.app.router.redirectTo('some/path')
from the client, the rendering order of views in a parent-child view hierarchy is often not correct. This is happening because in_postRender
we callattachChildViews
and then immediately trigger thepostRender
event, without waiting forattachChildViews
itself to be completed. In AMD environment, this often results in child views firing postRender before parent views, or in random order anyway. The solution is as simple as firingpostRender
only when the child views are attached, using a callback for it.Please let me know if this is not clear. What do you think?