tinymce / tinymce-angular

Official TinyMCE Angular Component
MIT License
320 stars 92 forks source link

Error when editor tag is within an mat-tab from the 2nd tab and onward. #333

Closed EliJArmstrong closed 4 months ago

EliJArmstrong commented 1 year ago

1. What is the current behavior?

If the editor tag is placed in the 2nd tab of an angular materials tab group (mat-tab). I get an error in the console:

Cannot read properties of undefined (reading 'length').

If the editor tag is placed within the first tab, then there is no problems.


2. Please provide the steps to reproduce and if possible a minimal demo of the problem

Placing an editor in the 2nd mat-tab of a angular material mat-tab-group

Here is a stackblitz with the editor in the 2nd tab (error shows): https://stackblitz.com/edit/angular-ivy-hbyt6o?file=src/app/app.component.html

Here is a stackblitz with the editor in the 1st tab (no error): https://stackblitz.com/edit/angular-ivy-s9sqca?file=src/app/app.component.html


3. What is the expected behavior?

No errors when placing the in the 2nd tab (mat-tab).


4. Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue?

I'm using Chrome Version 108.0.5359.125 (Official Build) (64-bit)

I was able to reproduce this error in Angular Versions 14.2.2 and 15.0.4

I was using TinyMCE-Angular version 7.0.0 for both Angular versions above.

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

Ref: INT-3080

danoaky-tiny commented 5 months ago

See here for our storybook using Material tabs: https://tinymce.github.io/tinymce-angular/?path=/story/editor--material-tabs Let us know if that helps.

Source: https://github.com/tinymce/tinymce-angular/blob/20c1991d6d4f6326a13527b4c6076fca8362ec64/stories/materialtabs/MaterialTabs.component.html#L1-L9 https://github.com/tinymce/tinymce-angular/blob/20c1991d6d4f6326a13527b4c6076fca8362ec64/stories/materialtabs/MaterialTabs.component.ts#L1-L22

danoaky-tiny commented 4 months ago

I'm closing this for now as its become stale. Feel free to comment here or reopen a new issue if needed.