-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow copy node's path #13
Comments
Thanks, good suggestion. I think this should be an explicit button in the ContextMenu, and possibly also a quick key. |
@josdejong how about copy |
Another idea it would be nice if you could paste a path too, and then scroll towards this path in the document. |
vote up for copy node path button near the breadcrumbs. Very handy and easy to implement 👍 |
Hi, I had to recently work around this issue by getting the path from a selected node through onChange (patchResult.from) function then reverting the changes in the document - basically making the doc readOnly but keeping the editable state in order to get the currently selected path. |
I'm working on this feature right now. I was wondering: what kind of path notation do you guys use? A JSON Path like |
@josdejong thanks a lot! I guess any will be fine if we can easily parse, split, modify it as we want. Some kind of trigger (onNodePathCopy) will be cool. personally I like the first one |
Yes I prefer a notation like What would be the use case for a |
@josdejong it would let anyone to parse and copy node path in the way one wants, not only as default |
Yes, that makes sense. I have a PR #164 ready. I have implemented a new option |
First version now published in Feedback is very welcome, I can imagine there are good ideas to refine this solution further. |
It would be nice to have the JSON path value through the API - on the current selected node, not just after a copy. This would basically be the same info that is displayed in the navigation bar, but in the API. How could I achieve this? I imagine it would be part of the exposed object jsonEditor - which there is a ref to... |
@feidhlimx there are plans to implement an API to get and set the selection, see #163. I think that will address your suggestion. |
The text was updated successfully, but these errors were encountered: