From daa8157eb8bddf5c6a3f986d19fd5853334189f6 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Mon, 5 Jul 2021 21:18:08 +0200 Subject: [PATCH] Closes #69 --- src/editor/Editor.jsx | 1 - src/editor/widgets/Autocomplete.jsx | 2 +- src/editor/widgets/comment/TextEntryField.jsx | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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() {