Repository navigation
fix(TextInput,NumberInput): tapping the clear button brings up the iOS keyboard - #8183
Conversation
…S keyboard The field took focus a frame after the tap (requestAnimationFrame), and iOS Safari only raises its keyboard for a focus made while handling the touch, so a field the tap reached unfocused ended up focused with no keyboard. Focus inside the tap, still with preventScroll.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsNumberInput (@astryxdesign/core) · View in Storybook
TextInput (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression46 of 494 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 26 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This review recommends approval: focusing the field inside the tap brings the iOS keyboard back after a clear with no API change, and the new tests pin the in-tap timing. One suggestion: packages/core/src/DateInput/TouchDateField.tsx records that preventScroll alone did not stop an iOS jump to the top on that read-only field, so a sentence on why these editable inputs differ would keep the two explanations from contradicting each other; your iOS runs show no jump here.
[Automated review]
User impact
On an iPhone, tapping the clear button of a TextInput or NumberInput that is not focused empties the field and focuses it, but no keyboard comes up. The person has to tap the field again to type the replacement they cleared the field for.
Problem and solution fit
Since #5440, the clear button's pointer path focuses the field a frame later (
requestAnimationFrame). iOS Safari raises its keyboard only for a focus made while handling the touch, so the later focus lands with no keyboard. #5440 deferred the focus to avoid a page jump to the top.preventScroll, which that change also added, is what prevents the jump; the deferral only broke the keyboard. This change keepspreventScrolland focuses inside the tap.Expected behavior and authority
UIKit's clear button makes its field the first responder: in a UIKit app on iOS 26.2 the keyboard starts rising 75 ms after the lift. No current record says otherwise; #5440 is the regression history. Siblings: #8158 makes the same change in PanelSearchInput; #6425, #7690, #7910, #7940 (TextInput) and #5978, #8015 (NumberInput) touch the same files with other intents.
Smallest restoration
Two lines in each of TextInput and NumberInput: the pointer path calls
focus({preventScroll: true})directly instead of in the next frame. The keyboard and assistive-technology path (detail === 0) is unchanged, as is the clear button'spreventDefaulton pointerdown, which keeps a focused field focused. DateInput, TimeInput, DateTimeInput and FileInput have the same pattern; their lanes own them.Evidence
Mobile Safari, iOS 26.2 (simulator), page scrolled 254 px, field unfocused with a value, one tap on its clear button:
(removed: it showed the browser's chrome)
preventScroll, and withoutrequestAnimationFrame. This replaces the test that pinned the deferral.Scope
Testing
pnpm vitest runon TextInput, NumberInput and Field: 15 files, 600 tests.check:changesets.