Skip to content

Commit

Permalink
fix: 修复form flex模式下,往第一个元素上面拖拽添加异常问题 (baidu#11292)
Browse files Browse the repository at this point in the history
* fix: 修复form flex模式下,往第一个元素上面拖拽添加异常问题

* fix
  • Loading branch information
qkiroc authored and lqPrototype committed Dec 5, 2024
1 parent 04d766b commit 036a368
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/amis-editor-core/src/layout/flex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ export default class FlexLayout implements LayoutInterface {
}
if (position === 'left') {
row = beforeRow;
}
if (position === 'right') {
} else if (position === 'right') {
row = preRow;
}

if (position === 'bottom' || position === 'top') {
} else if (position === 'top') {
row = preRow + 1 || 0; // 如果往第一个元素上边插入,preRow为undefined,所以设置0
} else if (position === 'bottom') {
row = preRow + 1;
}
}
Expand Down

0 comments on commit 036a368

Please sign in to comment.