Skip to content

Commit

Permalink
Merge pull request #28 from Liberty-liu/perf/drop
Browse files Browse the repository at this point in the history
perf: optimize drop logic and add id to inline child elements
  • Loading branch information
Liberty-liu authored Sep 21, 2023
2 parents 4b71f7d + 9579750 commit 8043373
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 8043373

Please sign in to comment.