react-diagrams
react-diagrams copied to clipboard
How to get selected Widget model infos and disable "backspace delete"
Hi, I have 2 questions actually.
-
[ ] Is there any way to get the model information from the selected widget?
-
[ ] And is anyway to remove the "backspace delete" from the diagram (I'm using TextInput inside node, and every time I try to delete some word, it delete the entire node)?
-
You can get all selected items by calling 'getSelectedItems' on the model.
-
You can remove the key binding that deletes items by setting the deleteKeys prop to an empty array in the DiagramWidget component:
<DiagramWidget
{...diagramProps}
// disables delete on backspace keyUp event
deleteKeys={[]}
/>