From ec5e66bfbec97e2c96f6db5dad455fa781e7195d Mon Sep 17 00:00:00 2001 From: Sam Arbid Date: Wed, 3 Jul 2024 21:46:14 +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 | 2 +- 2 files changed, 3 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..ec116bc9 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,7 +113,7 @@ class TimelineCommentEvent extends Component { {isEditing ? ( { this.setState({ commentContent: editor.getContent() }); }}