Angular4-JsonEditor icon indicating copy to clipboard operation
Angular4-JsonEditor copied to clipboard

'Tree' option is always shown on open

Open elsticky opened this issue 7 years ago • 1 comments

I've have the following editorOptions

    this.editorOptions = new JsonEditorOptions();
    this.editorOptions.modes = ['view', 'code']; // set all allowed modes

It looks like when opening the Editor it's always set to 'Tree' mode. When checking the dropdown it only shows 'View' and 'Code'. So I think there's something wrong with the filtering on initialization?

elsticky avatar Jan 04 '18 08:01 elsticky

@elsticky I got the same issue, and I have a workaround for this:

when you set a list of allowed modes, you also can set the current mode:

 this.editorOptions = new JsonEditorOptions();
 this.editorOptions.modes = ['view', 'code']; // set all allowed modes
 this.editorOptions.mode = 'view';

and view mode is "view" on opening

NovikovEvgeny avatar Feb 12 '18 11:02 NovikovEvgeny