toast-ui.react-editor icon indicating copy to clipboard operation
toast-ui.react-editor copied to clipboard

OnChange does not provide data

Open KonradKlimczak opened this issue 5 years ago • 5 comments

onChange callback on Editor only provides options of editor instead of data.

KonradKlimczak avatar Aug 07 '19 13:08 KonradKlimczak

I missed the same problem with you. Did you have any method to slove it?

hxj123 avatar Feb 04 '20 09:02 hxj123

don't remember exactly now, but there was some method on this API object to get current value, which is not perfect React solution to the problem.

KonradKlimczak avatar Feb 04 '20 11:02 KonradKlimczak

Hi, this is the answer

const content = this.editorRef.current.getInstance().getValue();

when you initialize you need to pass in a ref

i.e. <Editor ref={this.editorRef} previewStyle="none" ...

rwlaschin avatar Feb 14 '20 02:02 rwlaschin

Hi, this is the answer

const content = this.editorRef.current.getInstance().getValue();

when you initialize you need to pass in a ref

i.e. <Editor ref={this.editorRef} previewStyle="none" ...

Hi, this is the answer

const content = this.editorRef.current.getInstance().getValue();

when you initialize you need to pass in a ref

i.e. <Editor ref={this.editorRef} previewStyle="none" ...

it's good, thanks

hxj123 avatar Feb 14 '20 02:02 hxj123

it looks like a workaround not a solution

KonradKlimczak avatar Mar 27 '20 09:03 KonradKlimczak