From 590b430fb32a33139428d8f900cd26167452eeb4 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sun, 5 Sep 2021 07:55:52 +0200 Subject: [PATCH] Made auto-position behavior optional --- src/editor/Editor.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 1023259..9395d93 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -62,8 +62,13 @@ export default class Editor extends Component { } componentDidMount() { + // Defaults to true + const autoPosition = + this.props.autoPosition === undefined ? true : this.props.autoPosition; + // Init observer (triggers setPosition once) - this.removeObserver = this.initResizeObserver(); + if (autoPosition) + this.removeObserver = this.initResizeObserver(); } componentWillUnmount() {