Fix indexOf returns -1

This commit is contained in:
GogoVega 2024-05-21 16:06:15 +02:00
parent 707152d82f
commit 51208fcd0c
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B

View File

@ -606,7 +606,8 @@ RED.group = (function() {
for (var i=0; i<nodes.length; i++) {
n = nodes[i];
n.dirty = true;
var index = group.nodes.indexOf(n);
// TODO: Why Proxy indexOf returns -1 ?
var index = group.nodes.findIndex(function (node) { return node.id === n.id; });
group.nodes.splice(index,1);
if (reparent && parentGroup) {
n.g = group.g