Closed controllocked closed 2 weeks ago
Hello @controllocked, thank you for the feedback!
So you have a use case in which you want to enable node expansions, but disable removals (either delete key or the delete button), right?
If that's the case then unfortuantely no, currently you can only enable all or none of the node actions.
It is something that can be easily incorporated in the next version. Instead of passing True
and False
to the enable_node_actions
parameter, the user will be able to pass the actions (e.g. node_actions=['expand', 'remove']
) which allows for selecting only specific actions + makes it easier to incorporate more actions down the line.
Would appreciate your support in the following:
node_actions
parameter, and whether it will address your requirement. Thank you!
Thank you for your response @AlrasheedA .
Also is it possible to code a custom logic for remove action in the current version? I've tried, but it didn't work.
Thanks! I’ll include node_actions
in the next version. ✅
On remove custom logic, Currently, you can’t prevent the remove action from deleting the selected nodes. To ensure a smoother and faster experience, the remove event immediately deletes the nodes on the client side (in JavaScript) and then sends the event to Python, so that the developer can update the elements accordingly & implement additional implement custom logic (excluding NOT removing the elements).
To disable this behavior, you could fork the repo and remove a single line of code in JavaScript at nodeActions.js Line #43
For now, I don’t plan to change this behavior, as removing that line introduces a delay that affects the user experience. However, I’m happy to explore other options if there’s a strong use case for it or if there’s a different approach that maintains the immediate feedback for users.
Hello. Thank you for adding functionality that enlarge possible manipulations with nodes!
I would like to ask you about removal action: is it possible to turn this action off? I've tried to make this action do nothing, but it still deletes nodes.