We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6eaa02 commit 830371bCopy full SHA for 830371b
src/components/JsonViewer/JsonViewer.tsx
@@ -57,11 +57,10 @@ class Json extends React.PureComponent<JsonProps> {
57
58
collapseAll = () => {
59
const elements = this.node.getElementsByClassName('collapsible');
60
- for (const expanded of Array.prototype.slice.call(elements)) {
61
- // const collapsed = elements[i];
62
- if ((expanded.parentNode as Element)!.classList.contains('redoc-json')) {
63
- continue;
64
- }
+ // skip first item to avoid collapsing whole object/array
+ const elementsArr = Array.prototype.slice.call(elements, 1);
+
+ for (const expanded of elementsArr) {
65
(expanded.parentNode as Element)!.classList.add('collapsed');
66
}
67
};
0 commit comments