Skip to content

Commit

Permalink
perf: optimize drop logic and add id to inline child elements
Browse files Browse the repository at this point in the history
1.Remove delete field operation as invalid
2.Add id to inline child element
  • Loading branch information
Liberty-liu committed Sep 20, 2023
1 parent 7f3c51b commit 9579750
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/formEditor/components/Layout/ControlInsertionPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ function ControlInsertionPlugin (ER) {
if (!isBlock) {
if (oldEl.context) {
oldEl.context.delete()
utils.deepTraversal(oldEl, (node) => {
if (utils.checkIsField(node)) {
ER.delField(node)
}
})
// utils.deepTraversal(oldEl, (node) => {
// if (utils.checkIsField(node) && node.type !== 'subform') {
// ER.delField(node)
// }
// })
}
}
if (inserRowIndex !== '') {
Expand Down
3 changes: 2 additions & 1 deletion packages/formEditor/components/Layout/DragGable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export default defineComponent({
TypeComponent = load.findComponent('FormTypes', element.type)
const params = {
data: element,
parent: props.data
parent: props.data,
key: element.id
}
if (process.env.NODE_ENV === 'test') {
params['data-field-id'] = `${element.id}`
Expand Down

0 comments on commit 9579750

Please sign in to comment.