Skip to content

Commit

Permalink
editor: fix jumping cursor to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 committed Jul 3, 2024
1 parent 6cde34d commit 3011338
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/forms/RichEditor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of React-Invenio-Forms
// Copyright (C) 2022 CERN.
// Copyright (C) 2020 Northwestern University.
// Copyright (C) 2024 KTH Royal Institute of Technology.
//
// React-Invenio-Forms is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -19,7 +20,7 @@ import PropTypes from "prop-types";

export class RichEditor extends Component {
render() {
const { id, value, disabled, minHeight, onBlur, onChange, onFocus, editorConfig } =
const { id, value, disabled, minHeight, onBlur, onChange, onFocus, editorConfig, initvalue, onEditorChange } =

Check failure on line 23 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `·id,·value,·disabled,·minHeight,·onBlur,·onChange,·onFocus,·editorConfig,·initvalue,·onEditorChange·}·=` with `⏎······id,⏎······value,⏎······disabled,⏎······minHeight,⏎······onBlur,⏎······onChange,⏎······onFocus,⏎······editorConfig,⏎······initvalue,⏎······onEditorChange,`

Check failure on line 23 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'initvalue' is missing in props validation

Check failure on line 23 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'onEditorChange' is missing in props validation

Check failure on line 23 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Replace `·id,·value,·disabled,·minHeight,·onBlur,·onChange,·onFocus,·editorConfig,·initvalue,·onEditorChange·}·=` with `⏎······id,⏎······value,⏎······disabled,⏎······minHeight,⏎······onBlur,⏎······onChange,⏎······onFocus,⏎······editorConfig,⏎······initvalue,⏎······onEditorChange,`

Check failure on line 23 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

'initvalue' is missing in props validation

Check failure on line 23 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

'onEditorChange' is missing in props validation
this.props;

Check failure on line 24 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `·` with `}·=`

Check failure on line 24 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Replace `·` with `}·=`
const config = {
branding: false,
Expand All @@ -40,12 +41,14 @@ export class RichEditor extends Component {
return (
<Editor
initialValue={value}
value={initvalue}
init={config}
id={id}
disabled={disabled}
onChange={onChange}
onBlur={onBlur}
onFocus={onFocus}
onChange={onChange}
onEditorChange={onEditorChange}
/>
);
}
Expand Down

0 comments on commit 3011338

Please sign in to comment.