🐛 Fix increasing value clicking and dragging in a numeric input (#11334)

This commit is contained in:
Luis de Dios 2026-08-26 21:35:07 +02:00 committed by GitHub
parent 6e173a02fb
commit 2bce69f927
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 9 deletions

View File

@ -558,10 +558,8 @@
(mf/deps disabled is-open is-multiple? ref min max nillable default is-token-applied?)
(fn [event]
(when-not (or disabled is-open is-multiple? is-token-applied?)
(let [node (mf/ref-val ref)
is-focused (and (some? node) (dom/active? node))
has-token (some? (deref token-applied-name*))]
(when-not (or is-focused has-token)
(let [has-token (some? (deref token-applied-name*))]
(when-not has-token
(let [client-x (.-clientX event)
parsed (parse-value (str/trim (mf/ref-val raw-value*)) (mf/ref-val last-value*) min max nillable)
start-val (or parsed default 0)]
@ -610,7 +608,8 @@
(mf/set-ref-val! drag-state* :idle)
(dom/release-pointer event)
(when-let [node (mf/ref-val ref)]
(dom/focus! node)))
(dom/focus! node)
(dom/select-text! node)))
(when (= state :dragging)
(mf/set-ref-val! drag-state* :idle)
(dom/release-pointer event)

View File

@ -23,9 +23,7 @@
position: relative;
&.resizable {
&:not(:focus-within) {
cursor: ew-resize;
}
cursor: ew-resize;
}
&:hover {

View File

@ -96,7 +96,7 @@
}
&::selection {
background: var(--color-accent-select);
background: var(--color-accent-background-select);
}
&::placeholder {