During integration of TinyMCE in a react/next-js app, I was getting input value in reserve order, even while typing.
To fix it you must replace component attribute 'initialValue'
by 'value'
.
At end you’ll get something like this bellow:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<Editor onInit={(evt, editor) => editorRef.current = editor} value={value} init={{ height: 200, menubar: false, plugins: [ 'advlist autolink lists link charmap anchor' ], toolbar: 'undo redo | formatselect | ', content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }' }} onEditorChange={(content) => { setFieldValue(content); }} apiKey="xxx-yyy-zzz" disabled={disabled} id={id} key={id} /> |