Skip to content

Conversation

fredrivett
Copy link
Contributor

@fredrivett fredrivett commented Aug 17, 2021

There is also a PR for the dev branch in #131, this PR is for the 1.x branch


When a user specifies a depth to be collapsed, the intention is to make the JSON tidy so it is easy to visually parse.

Currently the deep prop only collapses at the specific level passed, and when a user opens that depth, all children are fully open.

I think this should collapse all children beyond the depth level, so that when the items are opened up the children are collapsed.

That said, for backwards compatibility I've implemented this as a new prop, defaulting to false, so that anyone upgrading won't see a change in behaviour.

I'm not sure on the naming of the prop, but feel like this would be beneficial and would resolve #125.

When a user specifies a depth to be collapsed, the intention is to make the JSON tidy so it is easy to visually parse.

Currently when the user then expands an item, it expands all its children fully, which is rarely the intention.

I think this should collapse all children beyond the depth level, so that when the items are opened up the children are collapsed.

That said, for backwards compatibility I've implemented this as a new prop, defaulting to false, so that anyone upgrading won't see a change in behaviour.
Let the user know about the new prop for collapsing all children at the level below the `deep` prop passed.
@fredrivett
Copy link
Contributor Author

I've tested this briefly locally and it does as intended, but only found this codebase today so can't guarantee there aren't any side effects, so recommend testing by the maintainers.

@leezng
Copy link
Owner

leezng commented Aug 21, 2021

A great feature. Can you help update the demo?

@leezng leezng self-requested a review August 21, 2021 12:42
@leezng leezng merged commit 80f6f5e into leezng:1.x Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants