Skip to content

Commit 95acde1

Browse files
authored
fix: properly focus text area when tapping on invalid icon on mobile (#9073)
* fix: properly focus text area when tapping on invalid icon * use touchend so that iOS 26 works
1 parent ecd2291 commit 95acde1

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
@@ -200,8 +200,8 @@ export const FieldGroup = forwardRef(function FieldGroup(props: FieldGroupProps,
200200
(e.currentTarget.querySelector('input, textarea') as HTMLElement)?.focus();
201201
}
202202
}}
203-
onPointerUp={e => {
204-
if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {
203+
onTouchEnd={e => {
204+
if (!(e.target as Element).closest('button,input,textarea')) {
205205
e.preventDefault();
206206
(e.currentTarget.querySelector('input, textarea') as HTMLElement)?.focus();
207207
}

0 commit comments

Comments
 (0)