tinymce / tinymce-webcomponent

MIT License
15 stars 7 forks source link

Cannot pass in config options as an object #51

Open MostafaNabi opened 1 year ago

MostafaNabi commented 1 year ago

Hey everyone, Im trying to pass in config options as an object like below

defaultConfig: RichTextConfigOptions = {
    removed_menuitems: 'undo redo',
    menu: {
      file: { title: 'File', items: 'newdocument restoredraft | preview | export print | deleteallconversations' },
    }
  }

  render() {
    return (
      <div id="rich-text-editor-wrapper">
        <script src='./tinymce.min.js' />
        <tinymce-editor
          menubar="false"
          config={this.defaultConfig}
        ></tinymce-editor>
      </div>
    );
  }

But it does not seem to register the attribute. The only reference on how to do this in the docs is this: https://www.tiny.cloud/docs/tinymce/6/webcomponent-ref/#setting-additional-configuration-options which involves passing in a string matching an object in the global config, which isn't a very realistic scenario. Any help would be greatly appreciated

exalate-issue-sync[bot] commented 1 year ago

Ref: INT-3154

tvquizphd commented 1 year ago

+1, but I'm grateful for the current global variable solution