From 6cf6521eb7dcb98688dde4e4b12f7d66ae65b9d0 Mon Sep 17 00:00:00 2001 From: Sam Arbid Date: Thu, 4 Jul 2024 00:16:29 +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 | 5 +++-- 2 files changed, 5 insertions(+), 4 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..ef933882 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 @@ -113,8 +113,9 @@ class TimelineCommentEvent extends Component { {isEditing ? ( { + initialValue={event?.payload?.content} + inputValue={commentContent} + onEditorChange={(event, editor) => { this.setState({ commentContent: editor.getContent() }); }} minHeight={150}