Skip to content

Commit

Permalink
fix(ui): null while query .editor-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Jan 18, 2023
1 parent cfe28ca commit 5dcbe6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/frontend/components/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)})))]
Expand Down

0 comments on commit 5dcbe6c

Please sign in to comment.