You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using easyimage with Reactive forms, it does not trigger the change on the form control, passing invalid data to the backend.
Only the placeholder image element tiggers the change, the one having the placeholder blob address:
When the image upload response arrive, the change to the src parameter to the final image url dont't trigger change, so, if you hit save in your app, the blob value gets sent to whatever backend functionality.
If after the image upload we make any change, then the correct src value with the correct image url gets passed.
The text was updated successfully, but these errors were encountered:
That's the reason why you see the properly updated src value of the image when you make some editor changes - the change event is fired and forms are notified about new editor content.
Therefore, the proper fix for this issue should be made in the editor itself, but I'm leaving that issue open here since we will need to write some test coverage for that anyway.
For anyone having this issue, i got around it by firing a 'change' event from the editor instance, inside a setTimeout. The delay amount appears to be irrelevant, but i set it to 100ms just in case.
ckEditorConfig: any = {
// ... other configurations are here, including the easyimage configurations
on:{
fileUploadResponse:($event)=>{
setTimeout(()=>{
$event.editor.fire('change')
},100)
}
}
}
And in the html: <ckeditor [config]="ckEditorConfig"></ckeditor>
When using easyimage with Reactive forms, it does not trigger the change on the form control, passing invalid data to the backend.
Only the placeholder image element tiggers the change, the one having the placeholder blob address:
When the image upload response arrive, the change to the src parameter to the final image url dont't trigger change, so, if you hit save in your app, the blob value gets sent to whatever backend functionality.
If after the image upload we make any change, then the correct src value with the correct image url gets passed.
The text was updated successfully, but these errors were encountered: