0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 14:12:36 -05:00

Dont submit token when text is selected

This commit is contained in:
Florian Schroedl 2024-05-22 16:29:18 +02:00
parent 5806ae7426
commit 5bccfa9e2f

View file

@ -142,7 +142,8 @@
enter? (kbd/enter? event) enter? (kbd/enter? event)
value (-> event dom/get-target dom/get-value) value (-> event dom/get-target dom/get-value)
caret-at-beginning? (nil? (.. event -target -selectionStart)) caret-at-beginning? (nil? (.. event -target -selectionStart))
delete-token? (and backspace? caret-at-beginning?) no-text-selected? (str/empty? (.toString (js/document.getSelection)))
delete-token? (and backspace? caret-at-beginning? no-text-selected?)
replace-token-with-value? (and enter? (seq (str/trim value)))] replace-token-with-value? (and enter? (seq (str/trim value)))]
(cond (cond
delete-token? (do delete-token? (do