mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 12:50:38 +00:00
fix: 暂时使用 live 模式作为条件判断是否限制选中 Page 组件
This commit is contained in:
parent
d4f8467abd
commit
0bab0307f7
@ -332,9 +332,8 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
if (isMulti && !isRootNode(node) && selection.has(id)) {
|
||||
selection.remove(id);
|
||||
} else {
|
||||
// TODO: 加个开关控制(yiyi)
|
||||
// 如果选中的为 Page 节点,则默认选中第一个子节点
|
||||
if (node.isPage() && node.getChildren()?.notEmpty()) {
|
||||
// TODO: 避免选中 Page 组件,默认选中第一个子节点;新增规则 或 判断 Live 模式
|
||||
if (node.isPage() && node.getChildren()?.notEmpty() && this.designMode === 'live') {
|
||||
const firstChildId = node
|
||||
.getChildren()
|
||||
?.get(0)
|
||||
|
||||
@ -178,8 +178,8 @@ export class Designer {
|
||||
selectionDispose = undefined;
|
||||
}
|
||||
const currentSelection = this.currentSelection;
|
||||
// TODO: yiyi 加开关控制,避免选中 Page 组件,默认选中第一个子节点
|
||||
if (currentSelection && currentSelection.selected.length === 0) {
|
||||
// TODO: 避免选中 Page 组件,默认选中第一个子节点;新增规则 或 判断 Live 模式
|
||||
if (currentSelection && currentSelection.selected.length === 0 && this.simulatorProps?.designMode === 'live') {
|
||||
const rootNodeChildrens = this.currentDocument.getRoot().getChildren().children;
|
||||
if (rootNodeChildrens.length > 0) {
|
||||
currentSelection.select(rootNodeChildrens[0].id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user