diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 259aaad..20551f2 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -9,7 +9,6 @@ import i18n from '../i18n'; const toArray = body => Array.isArray(body) ? body : [ body ]; - /** * The popup editor component. * diff --git a/src/editor/widgets/Autocomplete.jsx b/src/editor/widgets/Autocomplete.jsx index 08a9839..04e6cd8 100644 --- a/src/editor/widgets/Autocomplete.jsx +++ b/src/editor/widgets/Autocomplete.jsx @@ -19,7 +19,7 @@ export default class Autocomplete extends Component { this.element.current.querySelector('input').value = this.props.initialValue; if (this.props.focus) - this.element.current.querySelector('input').focus(); + this.element.current.querySelector('input').focus({ preventScroll: true }); } } diff --git a/src/editor/widgets/comment/TextEntryField.jsx b/src/editor/widgets/comment/TextEntryField.jsx index 444970d..eb7664d 100644 --- a/src/editor/widgets/comment/TextEntryField.jsx +++ b/src/editor/widgets/comment/TextEntryField.jsx @@ -20,8 +20,9 @@ export default class TextEntryField extends Component { } componentDidMount() { - if (this.props.focus && this.element.current) - this.element.current.focus(); + if (this.props.focus && this.element.current) { + this.element.current.focus({ preventScroll: true }); + } } render() {