Remove unloaders when root element is removed
When a controller calls preventDefault on its onunload method, it prevents the current root element from being unmounted via a route change. But it does not prevent it from being unmounted via m.mount(root, null). In that case, the root element is unmounted, but any unloaders that it had keep hanging on the `unloaders` array, and that prevented any future m.mount(root, component) calls from succeeding. This is what was happening on the pending route() tests. The fix is pretty simple: just reset the `unloaders` array when removing the root element, just like it's done when no unloader calls preventDefault. Also, 2 of the 4 pending tests were removed because they were identical to the other 2.
This commit is contained in:
parent
73dbc149b5
commit
3e51c8c2ff
2 changed files with 3 additions and 64 deletions
|
|
@ -1473,6 +1473,7 @@
|
|||
components.splice(index, 1)
|
||||
reset(root)
|
||||
nodeCache.splice(getCellCacheKey(root), 1)
|
||||
unloaders = []
|
||||
}
|
||||
|
||||
var redrawing = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue