angular-froala-wysiwyg icon indicating copy to clipboard operation
angular-froala-wysiwyg copied to clipboard

Can no longer dynamically change the toolbar buttons from version 3.2.1 and higher.

Open Warwizza opened this issue 4 years ago • 2 comments

Hi,

We recently updated from 3.1.0 to 3.2.5 and encountered an issue in this version. We cannot update the toolbarButtons programmatically when the editor is already on the screen. We used to be able to do that be reinitializing the editor after changing the options.

A reproduction of the issue can be found here. Reproduction steps on the html page in the StackBlitz

We are now back to version3.1.0, because this breaks our app...

Angular version 10.2.3. Froala version 3.2.1 and higher

Warwizza avatar Dec 22 '20 10:12 Warwizza

We have a similar case - it's impossible to reinitialize with new options only using the froala init controls received upon creation. They won't register the new options. You have to remove the editor and add it to back to the DOM :/. Like really destroy it.

We do this by adding a addToDOM boolean to the component and use an *ngIf on the editor element. Then we toggle it back and forth when we want to "reinitialize" it. Note: you have to run a changeDetectorRef.detectChanges() in between or else Angular won't recognize the "toggle".

sovanny avatar Jan 21 '21 07:01 sovanny

...sigh just updated myself, and aside from the angular warning about system.js refs, none of my editors are working. Wondering if it was a change to the options object etc... but because I need to load the options dynamically for img upload url, IE: [froalaEditor]="editorOptions" nothing seems to work... Sounds like same issue ?

Angular 10 Froala 3.2.6

JCanlett avatar Jan 29 '21 20:01 JCanlett