0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Clear value when pressing backspace as last action

This commit is contained in:
Florian Schroedl 2024-05-21 15:47:18 +02:00
parent 35f384ce9b
commit 7da382dfed

View file

@ -157,7 +157,9 @@
token (let [backspace? (kbd/backspace? event)
value (-> event dom/get-target dom/get-value)
caret-at-beginning? (= 0 (.. event -target -selectionStart))]
(set-token-value! value)
(cond
(and backspace? caret-at-beginning?) (set-value "")
:else (set-token-value! value))
(js/console.log "backspace?" caret-at-beginning? (.. event -target)))
is-open? (let [up? (kbd/up-arrow? event)
down? (kbd/down-arrow? event)]