Functions like removeNode have had restoreSelection built-in for years now. removeFromParent or their callers should do the same.
Currently, you can call insertBefore, trigger a node removal and the selection won't be recomputed which can lead to an invalid selection, see the referenced PR.
Functions like
removeNodehave had restoreSelection built-in for years now.removeFromParentor their callers should do the same.Currently, you can call
insertBefore, trigger a node removal and the selection won't be recomputed which can lead to an invalid selection, see the referenced PR.