Skip to content

Commit 0434057

Browse files
authored
fix: Numberfield keyboard on touch increment (#9281)
1 parent 6e76c3c commit 0434057

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@react-spectrum/s2/src/Field.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ export const FieldGroup = forwardRef(function FieldGroup(props: FieldGroupProps,
196196
{...otherProps}
197197
onPointerDown={(e) => {
198198
// Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)
199-
if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {
199+
if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea,[role="button"]')) {
200200
e.preventDefault();
201201
(e.currentTarget.querySelector('input, textarea') as HTMLElement)?.focus();
202202
}
203203
}}
204204
onTouchEnd={e => {
205-
if (!(e.target as Element).closest('button,input,textarea')) {
205+
if (!(e.target as Element).closest('button,input,textarea,[role="button"]')) {
206206
e.preventDefault();
207207
(e.currentTarget.querySelector('input, textarea') as HTMLElement)?.focus();
208208
}

0 commit comments

Comments
 (0)