added missing supercalls and related fixes

This commit is contained in:
Jakob Pinterits
2024-07-27 20:02:37 +02:00
parent 3504bd8e1c
commit 0da463a03a
15 changed files with 44 additions and 22 deletions
+5 -11
View File
@@ -359,16 +359,7 @@ export function updateComponentStates(
continue;
}
// Destruct the component and all its children
let queue = [component];
for (let comp of queue) {
queue.push(...comp.children);
comp.onDestruction();
delete componentsById[comp.id];
componentsByElement.delete(comp.element);
}
recursivelyDeleteComponent(component);
}
// If this is the first time, check if there's an #url-fragment and scroll
@@ -395,7 +386,7 @@ export function recursivelyDeleteComponent(component: ComponentBase): void {
// If this component had any dialogs attached, they must also go
for (let dialog of comp.ownedDialogs) {
dialog.onDestruction();
to_do.push(dialog);
// Inform Python about the destruction of the dialog
callRemoteMethodDiscardResponse('dialogRemoved', {
@@ -409,6 +400,9 @@ export function recursivelyDeleteComponent(component: ComponentBase): void {
// Remove it from the global lookup tables
delete componentsById[comp.id];
componentsByElement.delete(comp.element);
// And finally, remove it from the DOM
comp.element.remove();
}
}