From c8513f792e39f89373baa67bb17b53adf7efdf98 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Wed, 13 Jan 2021 12:11:28 +0500 Subject: [PATCH] fix: conflict editors are not scrollable --- apps/web/src/components/editor/react-quill.js | 2 +- apps/web/src/components/spliteditor/index.js | 14 +++++++++++--- .../web/src/components/spliteditor/simpleeditor.js | 13 ++++++++----- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/editor/react-quill.js b/apps/web/src/components/editor/react-quill.js index dd8cd6444..9f76ea5bf 100644 --- a/apps/web/src/components/editor/react-quill.js +++ b/apps/web/src/components/editor/react-quill.js @@ -173,7 +173,7 @@ export default class ReactQuill extends Component { ); } - onQuillInitialized(); + if (onQuillInitialized) onQuillInitialized(); } componentWillUnmount() { diff --git a/apps/web/src/components/spliteditor/index.js b/apps/web/src/components/spliteditor/index.js index 6fde21c95..500e8e7b2 100644 --- a/apps/web/src/components/spliteditor/index.js +++ b/apps/web/src/components/spliteditor/index.js @@ -43,12 +43,13 @@ function SplitEditor(props) { if (!conflictedNote || !localDelta || !remoteDelta) return null; return ( - + {conflictedNote.title} - + @@ -86,6 +92,7 @@ function SplitEditor(props) { - + import("../editor/react-quill")); function SimpleEditor(props) { const { delta, container, id, pref } = props; - useEffect(() => { - const toolbar = document.querySelector(`${container} .ql-toolbar.ql-snow`); - if (toolbar) toolbar.remove(); - }, [container]); + return ( }> { + const toolbar = document.querySelector( + `${container} .ql-toolbar.ql-snow` + ); + if (toolbar) toolbar.remove(); + }} placeholder="Type anything here" container={container} />