feat: 磁贴块的复制按钮点击支持滚动到新节点位置

This commit is contained in:
jianhui.fjh 2021-06-17 15:24:53 +08:00
parent 10dfbe9fc7
commit 3046018a36

View File

@ -178,10 +178,10 @@ export class ComponentMeta {
this._title =
typeof title === 'string'
? {
type: 'i18n',
'en-US': this.componentName,
'zh-CN': title,
}
type: 'i18n',
'en-US': this.componentName,
'zh-CN': title,
}
: title;
}
@ -436,6 +436,10 @@ const builtinComponentActions: ComponentAction[] = [
if (parent) {
const newNode = doc.insertNode(parent, node, index + 1, true);
newNode.select();
if (node.getRGL().isRGL) {
// 如果是磁贴块复制,则需要滚动到影响位置
setTimeout(() => newNode.document.simulator?.scrollToNode(newNode), 10);
}
}
},
},