react-json-view icon indicating copy to clipboard operation
react-json-view copied to clipboard

Custom Actions per Node - ability to paste clipboard under selected node

Open mattspeller opened this issue 5 years ago • 1 comments

Hello - not seen anything in the issue log or similar questions - apologies if duplication.

I am happy with the copy action, with the ability to store the selected node in the clipboard. As a JSON editor, the instant follow on is how do I paste that same JSON into another part of the tree?

  1. User selects a node, with a tree beneath depicting a shape they wish to clone.
  2. User select Copy icon.
  3. They hover over another node and click Paste Icon.
  4. JSON in clipboard is appended under node selected.

For this it would be most generic to add an ability to add custom actions to a node, I can add my own Paste Icon with callback and add the clipboard to the node in the event parameters. Or even simpler for me, React-Json-View adds enablePaste to the properties and support paste out of the box.

Any hints or tips most welcome.

Matt

mattspeller avatar Sep 16 '19 16:09 mattspeller

https://github.com/mac-s-g/react-json-view/issues/354 is for custom buttons, I don't know how easy it would be to implement a custom 'Paste Json' button.

chad-autry avatar Apr 24 '21 15:04 chad-autry