Skip to content

Commit

Permalink
comments: fix jumping cursor
Browse files Browse the repository at this point in the history
* these changes depending on thins PR: inveniosoftware/react-invenio-forms#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.
  • Loading branch information
Samk13 authored and utnapischtim committed Jul 28, 2024
1 parent 5e8a470 commit 5259c8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const TimelineCommentEditor = ({
/>
<Container fluid className="ml-0-mobile mr-0-mobile fluid-mobile">
<RichEditor
value={commentContent}
onChange={(event, editor) => {
inputValue={commentContent}
onEditorChange={(event, editor) => {
setCommentContent(editor.getContent());
}}
minHeight={150}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ class TimelineCommentEvent extends Component {

{isEditing ? (
<RichEditor
value={event?.payload?.content}
onChange={(event, editor) => {
initialValue={event?.payload?.content}
inputValue={commentContent}
onEditorChange={(event, editor) => {
this.setState({ commentContent: editor.getContent() });
}}
minHeight={150}
Expand Down

0 comments on commit 5259c8c

Please sign in to comment.