Explorar el Código

fix(ui): null while query .editor-wrapper

Andelf hace 3 años
padre
commit
5dcbe6cdf5
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/main/frontend/components/editor.cljs

+ 2 - 2
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)})))]