Skip to content

Commit

Permalink
InputText won't be focused on pressing buttons. (#7189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumeet-2023 authored Sep 15, 2024
1 parent 50bd7b6 commit 07ae25e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ export const InputNumber = React.memo(

const onUpButtonMouseDown = (event) => {
if (!props.disabled && !props.readOnly) {
DomHandler.focus(inputRef.current, props.autoFocus);
if (!DomHandler.isTouchDevice()) {
DomHandler.focus(inputRef.current, props.autoFocus);
}

repeat(event, null, 1);
event.preventDefault();
}
Expand Down Expand Up @@ -276,7 +279,10 @@ export const InputNumber = React.memo(

const onDownButtonMouseDown = (event) => {
if (!props.disabled && !props.readOnly) {
DomHandler.focus(inputRef.current, props.autoFocus);
if (!DomHandler.isTouchDevice()) {
DomHandler.focus(inputRef.current, props.autoFocus);
}

repeat(event, null, -1);
event.preventDefault();
}
Expand Down

0 comments on commit 07ae25e

Please sign in to comment.