Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix big objects not expandable & expanded state reset when not needed #27

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GerkinDev
Copy link

This fix introduce a Set that is used to store children's expanded state. If the json property is changed with an object containing the same keys, the children's expanded state is preserved.

Angular was updated to >=8.0.0.

Tell me if you need anything to merge this PR & publish the package. For info, it works well with quite heavy objects in my project.

For people passing by, you can install my build using the following command:

npm install git+https://github.com/GerkinDev/ngx-json-viewer.git#release

馃嵒 Cheers !

Use a Set to store keys expanded on each level. This way, the parent
stores expanded state of children & can keep state when the object
changes, without resetting everything.
@benkrig
Copy link
Contributor

benkrig commented Nov 29, 2019

How does this work with duplicate keys?

@GerkinDev
Copy link
Author

There's one set per object/array, so it can't have any duplicate keys.

@amarcazzo
Copy link

Could you please merge this pull request? 馃槂 @hivivo

@n3wtron
Copy link

n3wtron commented Jun 16, 2020

Hi, this repo looks dead, what do u think about open a new fork like ngx-json-viewer2 (if I'm not wrong the MIT licence allow it) and merge those PRs on that repo?

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.

None yet

4 participants