Skip to content

Commit

Permalink
fix(canvas): fix del key error when nothing is selected (opentiny#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
chilingling authored Nov 9, 2023
1 parent d1f0a35 commit da0fbd1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/canvas/src/components/container/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ export const removeNode = ({ parent, node }) => {
}

export const removeNodeById = (id) => {
if (!id) {
return
}

removeNode(getNode(id, true))
clearSelect()
getController().addHistory()
Expand Down

0 comments on commit da0fbd1

Please sign in to comment.