Open sallaben opened 3 months ago
The predecessor, jsoneditor
has a callback onExpand
that is invoked when a path is expanded/collapsed. We can look into implementing something like that.
More broadly thinking: it would be neat to implement an API where you can fully control the expanded state, similarly to how you can pass content
and selection
, with 2-way binding in Svelte, and extra getter/setter methods for the vanilla editor. This may require refactoring the data models of the expanded state, not sure, but we'll have to think that through before making it public.
That would be great! I used a predecessor but found this project more powerful for my needs!
The predecessor,
jsoneditor
has a callbackonExpand
that is invoked when a path is expanded/collapsed. We can look into implementing something like that.More broadly thinking: it would be neat to implement an API where you can fully control the expanded state, similarly to how you can pass
content
andselection
, with 2-way binding in Svelte, and extra getter/setter methods for the vanilla editor. This may require refactoring the data models of the expanded state, not sure, but we'll have to think that through before making it public.
Thanks for the reply! That is my intended usage too - I'd like to be able to store the entire editor state (content, selection, expanded, and any other pieces) in localstorage so that the editor loads the same way it was previously set to, persisting across page refresh.
Hi! Is it possible to get a list of the currently expanded paths from the editor instance in any way?