mirror of
https://github.com/penpot/penpot.git
synced 2025-07-25 18:17:27 +02:00
🐛 Fix unexpected exception on clicking empty area on creating comment
This commit is contained in:
parent
d019afe667
commit
869a412c74
2 changed files with 69 additions and 59 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue