Skip to content

Commit

Permalink
Fix: Remove all cloned descendants on reset (#53)
Browse files Browse the repository at this point in the history
* Fix: Remove all cloned descendants on reset

* Remove reverse to account for parent/child hierarchy

* Update js/BranchingSet.js

Co-authored-by: Cahir O'Doherty <[email protected]>

---------

Co-authored-by: Cahir O'Doherty <[email protected]>
  • Loading branch information
oliverfoster and cahirodoherty-learningpool authored Apr 11, 2024
1 parent 0684071 commit aba0972
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/BranchingSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ export default class BranchingSet {
parentView.nthChild--;
}
}
const descendants = model.getAllDescendantModels();
descendants.reverse().forEach(descendantModel => data.remove(descendantModel));
data.remove(model);
});
if (removeViews) parentView?.setChildViews(childViews);
Expand Down

0 comments on commit aba0972

Please sign in to comment.