jodit / jodit-angular

Angular wrapper for Jodit && Hey. Due to the fact that I do not use Angular in my projects, I cannot fix plugin errors in a timely manner. If you want the plugin to develop, send PR or better become a contributor
MIT License
49 stars 35 forks source link

Support Angular 15? Issue with setDisabledState #112

Open djdmorrison opened 1 year ago

djdmorrison commented 1 year ago

Hello,

Thanks for the Angular wrapper!

We've updated our app to Angular 15 but facing an error with jodit-angular. The package worked fine with Angular 14 so it's a recent update.

The error is Cannot read properties of undefined (reading 'setReadOnly'). This is thrown when setDisabledState() is called.

I believe the breaking change in Angular is the following: "In Angular 15, the setDisabledState is called when a ControlValueAccessor is attached. To avert using the same behavior, use FormsModule.withConfig or ReactiveFormsModule.withConfig."

A quick fix is to add a guard to setDisabledState() to check editor is defined.

setDisabledState(isDisabled: boolean): void {
    if (!this.editor) return; // guard to check if editor is defined.
    this.editor.setReadOnly(isDisabled);
}

I would submit a PR but not sure what else needs changing so just calling out this fix and hoping for a new version soon. Thanks!

juanfv2 commented 1 year ago

@djdmorrison , where I can change that? I have the same error.

MrElectroNick commented 1 year ago

Hi @djdmorrison @juanfv2 - fix will arrive within next couple days. Issue is confirmed. I'll let you know here when version for A15 will be published. Thanks for reporting!

thibaut129 commented 1 year ago

Hi @MrElectroNick,

Any news about this bug ? Thanks a lot :)

ptatoChi commented 1 year ago

Hello! When will the angular 15 support happen? :) Angular 16 is also around the corner. hope that gets supported too

Raw-Gel commented 1 year ago

HI any update regarding on this issue? I'm still encountering the problem

MrElectroNick commented 1 year ago

Hi @Raw-Gel - unfortunately project where jodit-angular is used with my supervision is still on angular 14 and I don't have enough time to handle builds for v15 and v16 along with fixing this issue. It would be good if someone can help. In any case at some point builds will arrive but I can't predict when

pedrochaves86 commented 1 year ago

Hello. There is any prediction to launch a version for Angular 15, 16? Just migrated to Angular 15 and getting the same reported error.

MrElectroNick commented 1 year ago

Hi @pedrochaves86 @juanfv2 @djdmorrison @thibaut129 - this issue is currently in work (FINALLY)