Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

[Feature Request] add option to hide root node #16

Open
rutsky opened this issue Sep 8, 2015 · 5 comments
Open

[Feature Request] add option to hide root node #16

rutsky opened this issue Sep 8, 2015 · 5 comments

Comments

@rutsky
Copy link
Contributor

rutsky commented Sep 8, 2015

Root node is something artificial/virtual in JSON documents, it would be nice to be able to hide it.

@Lapple
Copy link
Owner

Lapple commented Jan 18, 2016

It's been some time, but I would like to propose a CSS solution, there's a modifier on the root leaf element, check for json-inspector__leaf_root. Does that sound like a plausible solution?

@rutsky
Copy link
Contributor Author

rutsky commented Jan 18, 2016

I think CSS solution would be enough for this feature.

Such solution is hackish, because requires to attach external CSS to React component (and use implementation details: json-inspector__leaf_root), but this feature is in some way hakish too: it will work only if root object is object or list, and it doesn't make sense for other types of root object.

Perhaps you can document how this feature can be resolved using CSS, e.g. provide example in docs?
(I believe in addition to hiding root node label, subelements indentation should be removed)

@swillard-r7
Copy link

+1 also interested in doing this in a cleaner way

@skhavari
Copy link

this css will hide the first root and colon. verified it woks on objects and arrays.

.json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key {
    display: none;
}

@cmdelatorre
Copy link

We are already hiding it using CSS but I agree on that it would be great to have it as an option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants