tinymce / tinymce-angular

Official TinyMCE Angular Component
MIT License
324 stars 93 forks source link

Tinymce.init not working on the redirection from the app #226

Closed aviramroi closed 3 years ago

aviramroi commented 3 years ago

What is the current behavior? https://www.loom.com/share/932118fb3a5c48a0b24510ecb7b09ca9

I implement it this way - the #mymce1 is rendered


import "tinymce";
import "@tinymce/tinymce-angular";

declare var tinymce: any;

  ngOnInit() {
    let _this = this;
    tinymce.init({
      selector: "#mymce1",
      toolbar: "bold italic underline | alignleft aligncenter " + "alignright | bullist numlist  | ",
      menubar: false,
      statusbar: false,
      plugins: ["advlist autolink lists link ", " paste "],
      my_custom_variable: _this,
      init_instance_callback: this.handleValueChanged,
    });
}

What is the expected behavior? when the page is refreshed and reloaded it working as expected, when it redirected by the router of the app - it's not working

Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or TinyMCE-Angular?

angular version - 7.2.16 tinymce version - cloud 5

krishnafj commented 3 years ago

I am also having same issue with my angular app. Refresh/Reloading works but doesn't work when redirecting through router. Only textarea shows without the editor controls.

angular version - 9.0.5 tinymce version - cloud 5

jscasca commented 3 years ago

Hey @logikalcamp it seems like you are not using the tinymce-angular integration and you are initialising the editor by yourself? Do you get the same behaviour when using the editor tag from the tinymce-angular integration?

You can find more on how to use the integration here: Tinymce Angular quick start guide

@krishnafj are you using a similar code initialisation? If you are using the integration, can you provide a codesandbox replication of the issue?

liesahead commented 3 years ago

@krishnafj , if you see only textarea, maybe you forgot to import styles or scripts that are required for tinymce to work?

exalate-issue-sync[bot] commented 3 years ago

Ref: INT-2542

jscasca commented 3 years ago

Closing due to inactivity