mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
fix: the selectionDispose function is never executed
This commit is contained in:
parent
731dc58649
commit
30686a5bb8
@ -144,6 +144,8 @@ export class Designer implements IDesigner {
|
|||||||
|
|
||||||
private oobxList: OffsetObserver[] = [];
|
private oobxList: OffsetObserver[] = [];
|
||||||
|
|
||||||
|
private selectionDispose: undefined | (() => void);
|
||||||
|
|
||||||
@obx.ref private _componentMetasMap = new Map<string, IComponentMeta>();
|
@obx.ref private _componentMetasMap = new Map<string, IComponentMeta>();
|
||||||
|
|
||||||
@obx.ref private _simulatorComponent?: ComponentType<any>;
|
@obx.ref private _simulatorComponent?: ComponentType<any>;
|
||||||
@ -265,10 +267,9 @@ export class Designer implements IDesigner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupSelection = () => {
|
setupSelection = () => {
|
||||||
let selectionDispose: undefined | (() => void);
|
if (this.selectionDispose) {
|
||||||
if (selectionDispose) {
|
this.selectionDispose();
|
||||||
selectionDispose();
|
this.selectionDispose = undefined;
|
||||||
selectionDispose = undefined;
|
|
||||||
}
|
}
|
||||||
const { currentSelection } = this;
|
const { currentSelection } = this;
|
||||||
// TODO: 避免选中 Page 组件,默认选中第一个子节点;新增规则 或 判断 Live 模式
|
// TODO: 避免选中 Page 组件,默认选中第一个子节点;新增规则 或 判断 Live 模式
|
||||||
@ -284,7 +285,7 @@ export class Designer implements IDesigner {
|
|||||||
}
|
}
|
||||||
this.postEvent('selection.change', currentSelection);
|
this.postEvent('selection.change', currentSelection);
|
||||||
if (currentSelection) {
|
if (currentSelection) {
|
||||||
selectionDispose = currentSelection.onSelectionChange(() => {
|
this.selectionDispose = currentSelection.onSelectionChange(() => {
|
||||||
this.postEvent('selection.change', currentSelection);
|
this.postEvent('selection.change', currentSelection);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user