react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

How to get selected Widget model infos and disable "backspace delete"

Open mathiasbaldissera opened this issue 7 years ago • 1 comments

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)?

mathiasbaldissera avatar Jul 19 '19 18:07 mathiasbaldissera

  1. You can get all selected items by calling 'getSelectedItems' on the model.

  2. 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={[]}
/>

jackietieu avatar Jul 19 '19 21:07 jackietieu