KillerCodeMonkey / ngx-quill

Angular (>=2) components for the Quill Rich Text Editor
MIT License
1.79k stars 262 forks source link

Version 25 is broken due to formats are converted to object #1939

Closed visitek closed 1 month ago

visitek commented 1 month ago
            let formats = this.formats();
            if (!formats && formats === undefined) {
                formats = this.service.config.formats ?
                    Object.assign({}, this.service.config.formats) : (this.service.config.formats === null ? null : undefined);
            }

Quill expects to have array instead of object

KillerCodeMonkey commented 1 month ago

if i check the latest v25 version.. everything is fine: https://github.com/KillerCodeMonkey/ngx-quill/blob/v25.3.2/projects/ngx-quill/src/lib/quill-editor.component.ts#L296

KillerCodeMonkey commented 1 month ago

@visitek do you use the latest v25 version?

visitek commented 1 month ago

with using injection token, then it goes into the condition above. You can see Object.assign and that's the bug.. It makes object instead of array.. so quill then says forEach is not a function.

visitek commented 1 month ago

and yes.. it is in 25.3.2

KillerCodeMonkey commented 1 month ago

sorry but i do not see it. i linked the quill-editor component code of v25.3.2 and there is no Object.assign for the formats any more. it was there in earlier version of ngx-quill v25.

Just check the code i linked in my comment.

There arrays are used

visitek commented 1 month ago

https://github.com/KillerCodeMonkey/ngx-quill/blob/v25.3.2/projects/ngx-quill/src/lib/quill-view.component.ts

it's in view component. It is fixed in later version as well.. but for ng17 nope

KillerCodeMonkey commented 1 month ago

alrighty. the information about the quill view component was missing :)

KillerCodeMonkey commented 1 month ago

try v25.3.3 please

KillerCodeMonkey commented 1 month ago

@visitek does it work?