1
0
mirror of synced 2026-04-05 07:48:35 +08:00

fix(editor): 指定父节点添加组件

This commit is contained in:
roymondchen
2022-07-25 21:57:12 +08:00
committed by jia000
parent 923e8ea5ab
commit d334b697ae
3 changed files with 7 additions and 11 deletions

View File

@@ -223,7 +223,8 @@ export const fixNodeLeft = (config: MNode, parent: MContainer, doc?: Document) =
const el = doc.getElementById(`${config.id}`);
const parentEl = doc.getElementById(`${parent.id}`);
if (el && parentEl && el.offsetWidth + config.style?.left > parentEl.offsetWidth) {
const left = Number(config.style?.left) || 0;
if (el && parentEl && el.offsetWidth + left > parentEl.offsetWidth) {
return parentEl.offsetWidth - el.offsetWidth;
}