LGraphCanvas.onSelectionChange callback called twice
When switching selection from one node to the other, we get two events.
For example:
- Node 0 is selected
- We click on node 1
- We receive one event saying selection is now []
- We receive another event saying selection is now [1]
Is it the expected behaviour ? If you like I can modify it, that's an easy fix.
yes, because first you receive the deselection, and after that the selection of the new item
I understand that these are valid intermediate steps.
However, wouldn't it be more efficient to only trigger one event per action? Then it would be up to the developper to compare previous and new list of nodes and do the minimum modifications.
Currently, it is not possible.
If one select many nodes : [0,1,2,3,4,5,6], and then one more : [0,1,2,3,4,5,6,7].
One will get [] and then [0,1,2,3,4,5,6,7], so potentially, one will have to create new objects which one could have reused.