hivivo / ngx-json-viewer

JSON formatter and viewer in HTML for Angular
MIT License
174 stars 72 forks source link

Fix increase one `_currentDepth` in data update #116

Closed Timmatt-Lee closed 2 years ago

Timmatt-Lee commented 2 years ago

Originally, _currentDepth++ is in ngOnChanges() as initialization, which means, when instantiate a child node, init as its _currentDepth++. However, it brings a bug: when user update data in the top parent node, _currentDepth will be added one unintented, the view will looks like depth get minus one.

bug video demo

Timmatt-Lee commented 2 years ago

@hivivo could you take a look? Thanks.

zarda commented 2 years ago

Looks good to me!