Closed gpack closed 2 years ago
Try:
if(editor.node_selected != null) {
editor.node_selected.classList.remove("selected");
editor.node_selected = null;
editor.dispatch('nodeUnselected', true);
}
thanks Jero. that worked!
node_selected
is not exposed in angular package. It throws an error if I try to access it.
Also, editor.dispatch is not defined.
Angular package?
editor variable is the: const editor = new Drawflow...
I'm following this - https://stackoverflow.com/a/66268903/4955423
Here both this.editor.node_selected
and this.editor.dispatch
shows error.
Yeah, used with angular, we miss node_selected property (and probably many others).
I can't help in angular, I don't know how it works. Some repositories with angular: https://github.com/urveerendra/cpm-builder https://github.com/venkateshwarans/drawflow-angular https://github.com/RoyaghRamo/angular-drawflow-example
For someone who is having the same issue, I found out why most of the things don't work with angular.
Type declarations in @types
is for earliest version of Drawflow. It has a lot of properties missing.
I created custom types file for current drawflow version and now I'm able to use all the features.
How do you unselect nodes programmatically?
Example: When a user clicks on a button, I want to unselect the “selected / highlighted” node.