Fixes deleting undos
This commit is contained in:
parent
fcb11f19e3
commit
9626461ea7
4 changed files with 66 additions and 16 deletions
|
@ -58,6 +58,18 @@ export default function deleteSelected(data: Data) {
|
|||
page.shapes[shape.id] = shape
|
||||
}
|
||||
|
||||
for (let shape of childrenToDelete) {
|
||||
if (shape.parentId !== data.currentPageId) {
|
||||
const parent = page.shapes[shape.parentId]
|
||||
getShapeUtils(parent)
|
||||
.setProperty(parent, 'children', [...parent.children, shape.id])
|
||||
.onChildrenChange(
|
||||
parent,
|
||||
parent.children.map((id) => page.shapes[id])
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
data.selectedIds = new Set(selectedIds)
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue