Add fix explanation (#705)

master
km384 2022-01-19 14:08:03 +05:30 committed by GitHub
parent 7d56233647
commit 18f14755b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -762,7 +762,7 @@ export const convertToPath = (elem, attrs, svgCanvas) => {
const { nextSibling } = elem
batchCmd.addSubCommand(new svgCanvas.history.RemoveElementCommand(elem, nextSibling, elem.parentNode))
svgCanvas.clearSelection()
elem.remove()
elem.remove() // We need to remove this element otherwise the nextSibling of 'path' won't be null and an exception will be thrown after subsequent undo and redos.
batchCmd.addSubCommand(new svgCanvas.history.InsertElementCommand(path))
path.setAttribute('id', id)