Skip to content
Snippets Groups Projects
Commit c318e199 authored by rhenck's avatar rhenck
Browse files

[editor] Fix element panel still showing deleted element

parent 6d5182d2
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,7 @@ export abstract class CanvasElementOverlay { ...@@ -61,6 +61,7 @@ export abstract class CanvasElementOverlay {
]) ])
.subscribe((results: [UnitUIElement[], UnitPageSection]) => { .subscribe((results: [UnitUIElement[], UnitPageSection]) => {
this.unitService.deleteElementsFromSection(results[0], results[1]); this.unitService.deleteElementsFromSection(results[0], results[1]);
this.selectionService.clearElementSelection();
}) })
.unsubscribe(); .unsubscribe();
} }
......
...@@ -412,6 +412,7 @@ export class ElementPropertiesComponent implements OnInit, OnDestroy { ...@@ -412,6 +412,7 @@ export class ElementPropertiesComponent implements OnInit, OnDestroy {
.pipe(take(1)) .pipe(take(1))
.subscribe(selectedPageSection => { .subscribe(selectedPageSection => {
this.unitService.deleteElementsFromSection(this.selectedElements, selectedPageSection); this.unitService.deleteElementsFromSection(this.selectedElements, selectedPageSection);
this.selectionService.clearElementSelection();
}) })
.unsubscribe(); .unsubscribe();
} }
......
...@@ -74,10 +74,11 @@ export class SelectionService { ...@@ -74,10 +74,11 @@ export class SelectionService {
this._selectedElements.next(this.selectedElementComponents.map(componentElement => componentElement.element)); this._selectedElements.next(this.selectedElementComponents.map(componentElement => componentElement.element));
} }
private clearElementSelection() { clearElementSelection(): void {
this.selectedElementComponents.forEach((overlayComponent: any) => { this.selectedElementComponents.forEach((overlayComponent: any) => {
overlayComponent.setSelected(false); overlayComponent.setSelected(false);
}); });
this.selectedElementComponents = []; this.selectedElementComponents = [];
this._selectedElements.next([]);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment