mirror of
https://github.com/penpot/penpot.git
synced 2025-01-06 14:50:20 -05:00
Fix selectionStart not being detectable (selectionStart doesnt work for number)
This commit is contained in:
parent
b6061cc4a0
commit
ea9d850412
1 changed files with 2 additions and 3 deletions
|
@ -149,7 +149,7 @@
|
|||
token (let [backspace? (kbd/backspace? event)
|
||||
enter? (kbd/enter? event)
|
||||
value (-> event dom/get-target dom/get-value)
|
||||
caret-at-beginning? (nil? (.. event -target -selectionStart))
|
||||
caret-at-beginning? (zero? (.. event -target -selectionStart))
|
||||
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)))]
|
||||
|
@ -223,8 +223,7 @@
|
|||
:on-change handle-token-change-input
|
||||
:on-key-down handle-key-down
|
||||
:on-focus handle-focus
|
||||
:on-blur handle-blur
|
||||
:type type}]
|
||||
:on-blur handle-blur}]
|
||||
(= type "number") [:> numeric-input* {:autoFocus refocus?
|
||||
:value (or current-value "")
|
||||
:className input-class
|
||||
|
|
Loading…
Reference in a new issue