aor-rich-text-input icon indicating copy to clipboard operation
aor-rich-text-input copied to clipboard

Empty content on first load

Open DjLeChuck opened this issue 7 years ago • 6 comments

Coming from the listing, the field is empty. After hitting refresh button, the field is filled.

If I log the value received in componentDidMount, I see it's empty the first time and not the second one.

demo

DjLeChuck avatar Mar 27 '17 14:03 DjLeChuck

Can't reproduce the issue. Could you provide a simplified test case?

fzaninotto avatar Apr 12 '17 15:04 fzaninotto

I'm with the master branch not next, maybe the behaviour is different.

If I'm not wrong next should be available soon, so I can wait and test with it when it's out?

DjLeChuck avatar Apr 12 '17 15:04 DjLeChuck

next will be a bit late - expect it end of April.

fzaninotto avatar Apr 12 '17 15:04 fzaninotto

What is the status of this? It seems to be still open as far as I am concerned.

thomasstreckercc avatar Oct 06 '17 16:10 thomasstreckercc

I solved the problem by using another rich text editor. Even https://github.com/LoicMahieu/aor-tinymce-input has the same problem but the following implementation does work: https://github.com/HurricaneJames/react-tinymce-input

The problem seems to be that the rerendering of the component (happens multiple times on first draw) with changing values for the rich text input is not properly handled by the rich text editors. See https://github.com/instructure-react/react-tinymce/issues/21

renetalk avatar Oct 17 '17 07:10 renetalk

I experienced the same issue, and this is a workaround:

{ props.record.field_name? <RichTextInput source="field_name" /> : null}

it makes sure your data is available before rendering your RichTextInput

pbreah avatar Jan 17 '18 23:01 pbreah