From c65ab1be4416058399928fc155b59c50b9c849ee Mon Sep 17 00:00:00 2001 From: Sam Arbid Date: Thu, 4 Jul 2024 00:11:03 +0200 Subject: [PATCH] comments: fix jumping cursor * these changes depending on thins PR: https://github.com/inveniosoftware/react-invenio-forms/pull/244 * align porperty naming as RichEditior wrongly named value instead of initialValue * change onchange to onEditorChange as recommended in the tinymce docs. * Change the prop value to inputValue, as the name value seems to conflict with other elements, causing the input text in edit mode to behave oddly. --- .../timelineCommentEditor/TimelineCommentEditor.js | 4 ++-- .../invenio_requests/timelineEvents/TimelineCommentEvent.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineCommentEditor/TimelineCommentEditor.js b/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineCommentEditor/TimelineCommentEditor.js index b505c559..cca89c16 100644 --- a/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineCommentEditor/TimelineCommentEditor.js +++ b/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineCommentEditor/TimelineCommentEditor.js @@ -30,8 +30,8 @@ const TimelineCommentEditor = ({ /> { + inputValue={commentContent} + onEditorChange={(event, editor) => { setCommentContent(editor.getContent()); }} minHeight={150} diff --git a/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineEvents/TimelineCommentEvent.js b/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineEvents/TimelineCommentEvent.js index fd922ce1..0189f2a9 100644 --- a/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineEvents/TimelineCommentEvent.js +++ b/invenio_requests/assets/semantic-ui/js/invenio_requests/timelineEvents/TimelineCommentEvent.js @@ -114,7 +114,8 @@ class TimelineCommentEvent extends Component { {isEditing ? ( { + inputValue={commentContent} + onEditorChange={(event, editor) => { this.setState({ commentContent: editor.getContent() }); }} minHeight={150}