- Fix(ungrouping): Ensure there is always an anchor (fixes #393 ); also fixes a bug with the ungrouped elements not being properly selectable after the ungrouping
This commit is contained in:
@@ -6799,7 +6799,7 @@ this.ungroupSelectedElement = function () {
|
||||
|
||||
let i = 0;
|
||||
while (g.firstChild) {
|
||||
let elem = g.firstChild;
|
||||
const elem = g.firstChild;
|
||||
const oldNextSibling = elem.nextSibling;
|
||||
const oldParent = elem.parentNode;
|
||||
|
||||
@@ -6811,7 +6811,12 @@ this.ungroupSelectedElement = function () {
|
||||
continue;
|
||||
}
|
||||
|
||||
children[i++] = elem = anchor.before(elem);
|
||||
if (anchor) {
|
||||
anchor.before(elem);
|
||||
} else {
|
||||
g.after(elem);
|
||||
}
|
||||
children[i++] = elem;
|
||||
batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldParent));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user