Skip to content

Commit

Permalink
docs: improve the documentation of method expand
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Jan 24, 2025
1 parent cd66713 commit 577c3b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ editor.updateProps({
JSONEditor.prototype.expand(path: JSONPath, callback?: (relativePath: JSONPath) => boolean = expandSelf): Promise<void>
```
Expand or collapse paths in the editor. All nodes along the provided `path` will be expanded and become visible (rendered). So for example collapsed sections of an array will be expanded. Using the optional `callback`, the node itself and some or all of its nested child nodes can be expanded too. The `callback` function only iterates over the visible sections of an array and not over any of the collapsed sections. By default, the first 100 items of an array are visible and rendered.
Expand paths in the editor. All nodes along the provided `path` will be expanded and become visible (rendered). So for example collapsed sections of an array will be expanded. Using the optional `callback`, the node itself and some or all of its nested child nodes can be expanded too. The `callback` function only iterates over the visible sections of an array and not over any of the collapsed sections. By default, the first 100 items of an array are visible and rendered.
The method `expand` will not collapse any nodes that are already expanded. For example, `editor.expand([], relativePath => relativePath.length < 2)` will not collapse any expanded nodes with a path length of 2 or larger. To achieve that, all nodes can be collapsed first using `editor.collapse([])`.
Examples:
Expand Down

0 comments on commit 577c3b5

Please sign in to comment.