react-ckeditor icon indicating copy to clipboard operation
react-ckeditor copied to clipboard

Don't update content if it is undefined

Open abumalick opened this issue 6 years ago • 0 comments

Hello,

Thanks for the great plugin !

The problem

In the current state, if content prop is undefined, the editor would reset his content on every update.

The solution

Check if content prop is defined before updating editor data.

Why do we want that ?

(I don't want the editor to be fully controlled because it will cause a lot of useless renders and a lot of calls to getData(), I prefer to update my content on blur event

Notes

If someone needs to reset the editor he can pass an empty string to the content prop.

abumalick avatar Oct 15 '18 20:10 abumalick