🐛 Fix unexpected exception on clicking empty area on creating comment

This commit is contained in:
Andrey Antukh 2025-02-18 18:19:08 +01:00
parent d019afe667
commit 869a412c74
2 changed files with 69 additions and 59 deletions

View file

@ -282,9 +282,12 @@
(.selectAllChildren selection node))
(defn get-selection
"Only returns valid selection"
[]
(when-let [document globals/document]
(.getSelection document)))
(let [selection (.getSelection document)]
(when (not= (.-type selection) "None")
selection))))
(defn get-anchor-node
[^js selection]