Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the [data]="text" property not updates if text variable was changed #215

Closed
IgorKurkov opened this issue Jun 29, 2020 · 7 comments · Fixed by #348
Closed

the [data]="text" property not updates if text variable was changed #215

IgorKurkov opened this issue Jun 29, 2020 · 7 comments · Fixed by #348
Labels
squad:devops Issue to be handled by the Devops team. type:bug
Milestone

Comments

@IgorKurkov
Copy link

IgorKurkov commented Jun 29, 2020

Hello guys. I noticed some interesting behavior with ckeditor5-angular. So regular template of the editor:

 <ckeditor
    [config]="config"
    [data]="text"
    [editor]="Editor"
    (change)="handleChange($event)"
  ></ckeditor>

if the text property was changed by @Input() after the config is set - so text can't be changed inside the editor anymore.
For example:
I set up the field. set the config. text is still undefined. Editor loads with no text inside.
The @Input() receive variable text changes - and there some text already. But it isn't going forward to the <ckeditor> component. It does not affect this change of [data] unfortunately. As for me - it happened because change detection does not work as should inside component.
BTW we could use ngModel,

 <ckeditor
    [config]="config"
    [(ngModel)]="text"
    [editor]="Editor"
    (change)="handleChange($event)"
  ></ckeditor>

and it will be automatically updated/bound/etc, but - the question is - is it a non-overengineering way for this case? or do we need to have the working DI there? Am I wrong?

@Mgsy
Copy link
Member

Mgsy commented Jul 6, 2020

@ma2ciek, can you take a look at it?

@dashtaki
Copy link

This is my question as well.

@ma2ciek
Copy link
Contributor

ma2ciek commented Jul 29, 2020

Sorry guys for the late response, I'll take a look.

@ma2ciek ma2ciek self-assigned this Sep 6, 2020
@ma2ciek ma2ciek added this to the nice-to-have milestone Sep 6, 2020
@codejunction
Copy link

any update on this

@takarka
Copy link

takarka commented Jun 15, 2021

has anyone solved this problem?

@ma2ciek
Copy link
Contributor

ma2ciek commented Jun 30, 2021

This topic is quite large (detecting the input properties changes) and the data property is not the only one that can be changed runtime. I reported this issue in #264.

@IgorKurkov
Copy link
Author

Hi guys, soon 1 year anniversary of this case. Nothing special, but I think any dev meet this issue want to ask why so obvious bugs don't fix for so long time? there no problem with runtime, it's just about data binding. Anyway, hope you will resolve this issue sometime.

@Reinmar Reinmar added the squad:devops Issue to be handled by the Devops team. label Oct 28, 2021
akmal2409 pushed a commit to akmal2409/ckeditor5-angular that referenced this issue Feb 6, 2023
Fixed the bug outline in the issue ckeditor#215 where the angular component
does not update the editor contents
on changed data property.

Implemented OnChanges interface that checks if the data
property has been changed.
If it has been, then we write a new value to the editor.

Lastly, added one more unit test case to assert the fix.
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 6, 2023
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 10, 2023
@CKEditorBot CKEditorBot added this to the iteration 61 milestone Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:devops Issue to be handled by the Devops team. type:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants