Closed benswinburne closed 1 year ago
@benswinburne
I checked the code and only see the trigger executed here:
https://github.com/retejs/rete/blob/88373184be4b6fda65048a0e262563bf87f7bbdf/src/view/node.ts#L77
I tested it locally and it will trigger on select. So I don't get the error.
The result is exactly the same as if you check for selectnode
.
editor.on('selectnode', (nodes) => {
console.log('selectnode', nodes);
});
Is selectnode
working?
If you need your selections you can use editor.selected.list
@creadicted I'd come to the same conclusion and used another event. I also can't replicate the problem on codesandbox to show you now so I'll work out what might be different about my local copy.
I've used which is sufficient for now.
editor.on('nodeselected', (node) => {
options.setSelected([...editor.selected.list]);
});
That said, it'd be nice if the multiselectnode event fired only when 1 or more nodes were selected and passed in [nodes]
instead of just node
perhaps.
I'll try and get this replicated and post later.
That said, it'd be nice if the multiselectnode event fired only when 1 or more nodes were selected and passed in
[nodes]
instead of justnode
perhaps.
I added a Pullrequest. I would argue that mutliselectnode
should be triggered if its higher than one. https://github.com/retejs/rete/pull/462
That's what I meant :) makes sense for multi when > 1 is selected, definitely.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
I was trying to use the
mutliselectnode
event which admittedly doesn't appear to be documented but it seems to be in the codebase and I've seen it in a few responses to issues here.However, I'm getting the error seen in the title when attaching this event to my editor.