strapi-plugin-wysiwyg-toastui icon indicating copy to clipboard operation
strapi-plugin-wysiwyg-toastui copied to clipboard

Fix the timing of setting the editor value

Open sergeystoma opened this issue 4 years ago • 3 comments

Related to https://github.com/fagbokforlaget/strapi-plugin-wysiwyg-toastui/issues/3

sergeystoma avatar Feb 15 '21 19:02 sergeystoma

@shardiwal Could you please verify this PR?

iapain avatar Feb 17 '21 21:02 iapain

@sergeystoma Thank you for this patch it fixed the issue I was having perfectly.

JoshuaJWayne avatar May 26 '21 05:05 JoshuaJWayne

can use componentDidUpdate

componentDidUpdate(prevProps, prevState, snapshot) {
    if (this.props.value !== prevProps.value && prevProps.value == null) {
      const editor = this.editorRef.current.getInstance();
      editor.setMarkdown(this.props.value, false);
    }
}

wrrwrr111 avatar Sep 10 '21 07:09 wrrwrr111