From 5dcbe6cdf53698d3747f9ba48d711dec1f1f5b70 Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 18 Jan 2023 15:21:57 +0800 Subject: [PATCH] fix(ui): null while query .editor-wrapper --- src/main/frontend/components/editor.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/components/editor.cljs b/src/main/frontend/components/editor.cljs index a98981a16..0b3e14608 100644 --- a/src/main/frontend/components/editor.cljs +++ b/src/main/frontend/components/editor.cljs @@ -381,8 +381,8 @@ :z-index 11} (when set-default-width? {:width max-width}) - (let [^js/HTMLElement editor - (js/document.querySelector ".editor-wrapper")] + (when-let [^js/HTMLElement editor + (js/document.querySelector ".editor-wrapper")] (if (<= (.-clientWidth editor) (+ left (if set-default-width? max-width 500))) {:right 0} {:left (if (or (nil? y-diff) (and y-diff (= y-diff 0))) left 0)})))]