Skip to content

feat(TextInput,TextArea): tell a touch keyboard what the field holds - #8166

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c08-text-traits
Nov 2, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c08-text-traits

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

User need

On a phone the keyboard is part of the form: a search box wants a Search key, a phone number the phone pad, a one-time code the number pad, a username no capitalization or correction. TextInput and TextArea can't say so today: these props are type errors and type takes only text, password and email, so every field opens the browser's default keyboard. #6307 asks for inputMode and type="search" (thanks to bmvantunes).

Problem and solution fit

  • enterKeyHint, inputMode, autoCapitalize and hasAutoCorrect on TextInput and TextArea, plus hasSpellCheck on TextInput (TextArea already has it). Each renders its native attribute (autocorrect="on"/"off", spellcheck="true"/"false") and nothing when unset, so existing fields keep the browser's defaults.
  • TextInput's type also takes search (a searchbox), tel and url.
  • They only choose the keyboard: what Enter does, the value, validation and submission don't change.
  • One mapping, Field/textEntryTraits.ts, feeds both fields.

Current specification

component:TextInput FR16, AR6 and DEC-1, and component:TextArea FR13, recorded in #9424. component:swift/TextInput FR6: the Swift contract carries none of these until the Swift field applies them. This pull request closes the records' implementation and evidence gaps for these props.

Public delta and caller burden

  • The props and type values above, optional and additive: a patch [feat]. An unset prop renders nothing.
  • New exported types, closed unions of the HTML-standard values with no string widening, so TypeScript rejects any other value: EnterKeyHint (enter, done, go, next, previous, search, send), InputMode (none, text, tel, url, email, numeric, decimal, search) and AutoCapitalize (off, none, on, sentences, words, characters).
  • No theming change. type="search" gives the field the searchbox role.
  • Swift: unchanged. The props are web-only and type projects onto text, password and email, so the generated Swift is identical to main's.
<TextInput label="Verification code" value={code} onChange={setCode}
  inputMode="numeric" autoComplete="one-time-code" enterKeyHint="done" />
<TextInput label="Username" value={name} onChange={setName}
  autoCapitalize="none" hasAutoCorrect={false} hasSpellCheck={false} />

Design and alternatives

DEC-1's model: only the caller knows that a field holds a phone number or a one-time code, so the caller chooses; the props keep the native names, with the on/off natives as has… booleans, and each value set is a closed union. Rejected: admitting the DOM attributes through the shared base props (every component would take them, and the boolean natives break the has… naming), and deriving the keyboard from type (iOS already does for email, URL, phone and password, but a Search key or a code's number pad is intent only the caller knows).

Evidence

iOS: TextInput, TextArea TextInput on iOS TextArea on iOS
iOS: Return key per hint Return keys on iOS
Android: TextInput, TextArea, action key per hint TextInput on Android TextArea on Android Action keys on Android
  • Chromium on a phone viewport with touch emulation: TextInputKeyboardTraits.a11y.chromium.spec.ts and TextAreaKeyboardTraits.a11y.chromium.spec.ts tap every field of the Keyboard Traits stories and read exactly the attributes its props set, and none it leaves unset: 20 of 20 runs alone, and 20 of 20 at 4 workers on two pinned cores.
  • Render tests: no attribute while a prop is unset; each prop set, with hasAutoCorrect and hasSpellCheck on and off; type renders search (a searchbox), tel and url; Enter calls onEnter under every enterKeyHint; TextArea's Return stays a line break.
  • Type test (textEntryTraits.public.test.ts, run by pnpm typecheck): each union is exactly the HTML-standard values, both fields' props use it, and an arbitrary or unnarrowed string is rejected. Widening the three unions with string makes it report 16 errors.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

  • R1 narration: none found; the edited rows state behavior and name tests.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; the verification rows name test files.
  • R4 rejected alternatives over one line or outside a decision: none added.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.

Testing

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 2, 2026 12:49pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 2, 2026, 1:06 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 69264cf

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Field 39.6 kB (0) · 8.3 kB CSS (0) — ✗ · ✓ · —
FieldLabel 33.3 kB (0) · 5.9 kB CSS (0) — ✗ · ✓ · —
lab/ChatEmojiPicker 62.9 kB (+192 B) · 773 B CSS (0) — — · — · —
28 more components
Component Size LoC Visual · A11y · RTL
lab/ChatReactionBar 63.5 kB (+180 B) · 1.1 kB CSS (0) — — · — · —
lab/MobileTokenizer 99.2 kB (+159 B) · 880 B CSS (0) — — · — · —
lab/EmojiPicker 68.3 kB (+158 B) · 722 B CSS (0) — — · — · —
lab/TransferListSelector 78.8 kB (+155 B) · 1.9 kB CSS (0) — — · — · —
lab/Comments 230.2 kB (+154 B) · 2.5 kB CSS (0) — — · — · —
lab/TransferList 72.5 kB (+153 B) · 1.7 kB CSS (0) — — · — · —
TextInput · Storybook 50.9 kB (+149 B) · 10.9 kB CSS (0) 419 (+18) ✓ · ✓ · —
lab/CommentComposer 100.5 kB (+148 B) · 1.9 kB CSS (0) — — · — · —
PowerSearch 180.6 kB (+139 B) · 20.5 kB CSS (0) — — · — · —
lab/CommentThread 224.9 kB (+139 B) · 2.4 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 219.7 kB (+132 B) · 454 B CSS (0) — — · — · —
lab/MobilePowerSearch 164.9 kB (+125 B) · 1.2 kB CSS (0) — — · — · —
TextArea · Storybook 45.4 kB (+112 B) · 9.8 kB CSS (0) 496 (+14) ✓ · ✓ · ✓
ComplexSelector 53.5 kB (0) · 11.1 kB CSS (0) — — · — · —
DateInput 98.7 kB (0) · 15.3 kB CSS (0) — — · — · —
DateRangeInput 67.6 kB (0) · 11.7 kB CSS (0) — — · — · —
DateTimeInput 111.0 kB (0) · 15.8 kB CSS (0) — — · — · —
FileInput 51.8 kB (0) · 10.7 kB CSS (0) — — · — · —
InputGroup 40.2 kB (0) · 8.4 kB CSS (0) — — · — · —
MultiSelector 70.9 kB (0) · 15.2 kB CSS (0) — — · — · —
NumberInput 53.1 kB (0) · 11.2 kB CSS (0) — — · — · —
Pagination 84.1 kB (0) · 15.9 kB CSS (0) — — · — · —
Selector 75.0 kB (0) · 15.6 kB CSS (0) — — · — · —
TimeInput 86.5 kB (0) · 14.3 kB CSS (0) — — · — · —
Tokenizer 68.2 kB (0) · 17.1 kB CSS (0) — — · — · —
Typeahead 60.9 kB (0) · 11.8 kB CSS (0) — — · — · —
lab/ListInput 80.0 kB (0) · 1.6 kB CSS (0) — — · — · —
richtext/RichTextEditor 274.3 kB (0) · 2.6 kB CSS (0) — — · — · —
Visual changes: 2 snapshots in 1 component

A change is a question for the reviewer, not a failure.

Component · story Before After Diff
Field · Default (neutral, light) before frame after frame diff frame
Field · Default (neutral, dark) before frame after frame diff frame

Package size: @astryxdesign/core 5.81 MB packed (+5.4 kB); no new dependencies.

API changes: core +15 · ~3 · −0

Committed API report behind this build: core 23 rows; run pnpm api:report.

18 API changes (advisory)
Package Where Signature Usage
+ core . · Components · component TextArea prop autoCapitalize?: AutoCapitalize <TextArea autoCapitalize={…} />
+ core . · Components · component TextArea prop enterKeyHint?: EnterKeyHint <TextArea enterKeyHint={…} />
+ core . · Components · component TextArea prop hasAutoCorrect?: boolean <TextArea hasAutoCorrect />
+ core . · Components · component TextArea prop inputMode?: InputMode <TextArea inputMode={…} />
+ core . · Components · component TextInput prop autoCapitalize?: AutoCapitalize <TextInput autoCapitalize={…} />
+ core . · Components · component TextInput prop enterKeyHint?: EnterKeyHint <TextInput enterKeyHint={…} />
+ core . · Components · component TextInput prop hasAutoCorrect?: boolean <TextInput hasAutoCorrect />
+ core . · Components · component TextInput prop hasSpellCheck?: boolean <TextInput hasSpellCheck />
+ core . · Components · component TextInput prop inputMode?: InputMode <TextInput inputMode={…} />
+ core . · Types · type AutoCapitalize type AutoCapitalize = 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters' import type {AutoCapitalize} from '@astryxdesign/core'
+ core . · Types · type EnterKeyHint type EnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' import type {EnterKeyHint} from '@astryxdesign/core'
+ core . · Types · type InputMode type InputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' import type {InputMode} from '@astryxdesign/core'
+ core ./Field · Also exported from an earlier entry point · AutoCapitalize AutoCapitalize (.) import {AutoCapitalize} from '@astryxdesign/core/Field'
+ core ./Field · Also exported from an earlier entry point · EnterKeyHint EnterKeyHint (.) import {EnterKeyHint} from '@astryxdesign/core/Field'
+ core ./Field · Also exported from an earlier entry point · InputMode InputMode (.) import {InputMode} from '@astryxdesign/core/Field'
~ core . · Types · interface TextAreaProps interface TextAreaProps extends Omit<FieldInputBaseProps, 'onChange' | 'defaultValue'> (props of TextArea) → interface TextAreaProps extends Omit<FieldInputBaseProps, 'onChange' | 'defaultValue'>, TextEntryTraitProps (props of TextArea) import type {TextAreaProps} from '@astryxdesign/core'
~ core . · Types · interface TextInputProps interface TextInputProps extends Omit<FieldInputBaseProps, 'onChange' | 'defaultValue'> (props of TextInput) → interface TextInputProps extends Omit<FieldInputBaseProps, 'onChange' | 'defaultValue'>, TextEntryTraitProps (props of TextInput) import type {TextInputProps} from '@astryxdesign/core'
~ core . · Types · type TextInputType type TextInputType = 'text' | 'password' | 'email' → type TextInputType = 'text' | 'password' | 'email' | 'search' | 'tel' | 'url' import type {TextInputType} from '@astryxdesign/core'

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner providing or identifying the governing spec for this addition. No current spec admits the new TextInput/TextArea keyboard props (enterKeyHint, inputMode, autoCapitalize, hasAutoCorrect, and hasSpellCheck on TextInput), the exported TextEntry* types or TextInput's search, tel and url types, and none decides whether TextInput's new props join its portable (Swift) contract or stay web-only. An engineering owner can record that decision by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so if they are an engineering owner. Whatever the decision, these fixes are needed:

  • The committed TextInput.swift binding is stale, so packages/native/src/contract/contracts.test.ts and the test check fail: regenerate it with pnpm -F @astryxdesign/native generate:apple, or mark the new props web-only in packages/native/src/components/TextInput.ts, whichever matches the decision.
  • TextInput.tsx sets spellCheck={hasSpellCheck} after the props spread, so an untyped spellCheck that used to reach the input is now dropped when hasSpellCheck is unset.
  • The new sentence saying that turning spell checking off stops iOS from replacing quotes and dashes needs iOS Safari evidence, or should be removed.

[Automated review]

autoCapitalize,
hasAutoCorrect,
})}
spellCheck={hasSpellCheck}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spellCheck={hasSpellCheck} comes after {...fieldProps}, so when hasSpellCheck is unset it overrides an untyped spellCheck with undefined. An untyped spellCheck: false rendered spellcheck="false" on the base and renders nothing here. Render it only when it is set (for example {...(hasSpellCheck != null && {spellCheck: hasSpellCheck})}, or inside textEntryTraitAttributes), the way the other traits leave unset keys out.

{
name: 'type',
type: "'text' | 'password' | 'email'",
type: "'text' | 'password' | 'email' | 'search' | 'tel' | 'url'",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The native contract reads this file, so these type values and the five new props project into the generated Swift TextInputProps. The committed packages/native/apple/Sources/AstryxNative/Generated/TextInput.swift was not regenerated, and packages/native/src/contract/contracts.test.ts fails with "TextInput.swift is stale". Regenerate it with pnpm -F @astryxdesign/native generate:apple, or list the props under webOnly in packages/native/src/components/TextInput.ts if they should stay web-only.

name: 'hasSpellCheck',
type: 'boolean',
description:
'Whether misspelled words are underlined (the native `spellcheck`). Turning it off also stops iOS from replacing quotes and dashes with their typographic forms. Unset, the browser decides.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iOS evidence in the description does not cover this claim (turning spell checking off also stops smart quotes and dashes). spec:AST-013 FR10 asks for Safari evidence for a claim about a named browser, so please attach that observation or drop the sentence. It also appears in TextArea.doc.mjs, in both Chinese entries and in both JSDoc comments.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner providing or identifying the governing spec for the new TextInput and TextArea keyboard props (enterKeyHint, inputMode, autoCapitalize, hasAutoCorrect, and hasSpellCheck on TextInput), the exported TextEntry* types and TextInput's search, tel and url types, including whether TextInput's new props belong in its portable Swift contract, as this head generates them, or stay web-only like autoComplete. An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so if they are an engineering owner. The regenerated Swift binding now matches its generator; two fixes are still needed whatever the decision:

  • TextInput.tsx sets spellCheck={hasSpellCheck} after the props spread, so an untyped spellCheck that used to reach the input is now dropped when hasSpellCheck is unset; render it only when it is set, as the other traits are.
  • The sentence saying that turning spell checking off stops iOS from replacing quotes and dashes needs iOS Safari evidence, or should be removed.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner providing or identifying the governing spec for the new TextInput and TextArea keyboard props (enterKeyHint, inputMode, autoCapitalize, hasAutoCorrect, and hasSpellCheck on TextInput), the exported TextEntry* types and TextInput's search, tel and url types, including where TextInput's new props belong under spec:AST-082 FR3 and DEC-14, which keep in the core only props that every platform offering the component honors, since this head generates them into the Swift contract for both iOS and macOS. An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so if they are an engineering owner. Two fixes are needed whatever the decision:

  • TextInput.tsx sets spellCheck={hasSpellCheck} after the props spread, so an untyped spellCheck that used to reach the input is dropped while hasSpellCheck is unset; render it only when it is set, as the other traits are.
  • The new sentence saying that turning spell checking off stops iOS from replacing quotes and dashes needs iOS Safari evidence, or should be removed.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner providing or identifying the governing spec for the new TextInput and TextArea keyboard props (enterKeyHint, inputMode, autoCapitalize, hasAutoCorrect, and hasSpellCheck on TextInput), the exported TextEntry* types and TextInput's search, tel and url types, including where TextInput's new props belong under spec:AST-082 FR3 and DEC-14, since this head generates them into the Swift contract for both iOS and macOS. An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so if they are an engineering owner. The earlier spellCheck and smart-punctuation fixes are in; one fix is still needed whatever the decision:

  • The autoCapitalize docs say iOS leaves password and email fields uncapitalized, but the iOS screenshots show neither field (spec:AST-013 FR10): attach that observation, or narrow the sentence to the default and URL cases they show.

[Automated review]

name: 'autoCapitalize',
type: "'none' | 'sentences' | 'words' | 'characters'",
description:
'When a touch keyboard capitalizes as you type (the native `autocapitalize`). Unset, iOS capitalizes sentences except in password, email and URL fields.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence names iOS behavior for password and email fields, but the iOS screenshots in the description show only default fields and the url field. spec:AST-013 FR10 asks for evidence from the actual browser for a claim about a named browser: please attach an iOS Safari observation of an unset type="email" and type="password" field, or narrow the sentence to the cases shown. The same sentence is at TextArea.doc.mjs:281 and in both Chinese entries.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding whether to admit this touch-keyboard API: the current component:TextInput record closes type to text, password and email and leaves keyboard hints uncontracted, and component:TextArea admits none of the new traits, so admitting enterKeyHint, inputMode, autoCapitalize, hasAutoCorrect, TextInput's hasSpellCheck, the search, tel and url types and the TextEntry* exports means updating those two records and deciding whether TextInput's new props belong in its portable Swift contract under spec:AST-082 FR3 and DEC-14. An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so as an engineering owner. One fix is needed whatever the decision:

  • The autoCapitalize docs say iOS leaves password and email fields uncapitalized, but the iOS screenshots show neither field (spec:AST-013 FR10): attach that observation, or narrow the sentence to the default and URL cases they show.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding whether to admit this touch-keyboard API: the current component:TextInput record closes type to text, password and email and leaves keyboard hints uncontracted, and component:TextArea admits none of the new traits, so admitting enterKeyHint, inputMode, autoCapitalize, hasAutoCorrect, TextInput's hasSpellCheck, the search, tel and url types and the TextEntry* exports means updating those two records and deciding whether TextInput's new props belong in its portable Swift contract under spec:AST-082 FR3 and DEC-14. An engineering owner records that decision by amending the two records, either on main or in this pull request approved by commenting /approve-spec followed by the full head SHA, and the author may do so as an engineering owner. Whatever the decision, the iOS claims in Field/textEntryTraits.ts (the keyboard list on TextEntryInputMode and the password and email sentence in the file header) need iOS Safari evidence, or narrowing to the cases the screenshots show, as the docs now are.

[Automated review]

Comment on lines +43 to +47
* Which touch keyboard a field asks for. iOS shows the phone pad for `tel`,
* the number pad for `numeric`, the decimal pad for `decimal`, the URL and
* email keyboards for `url` and `email`, the web-search keyboard (a period
* key and a Go key, whatever `enterKeyHint` says) for `search`, and no
* keyboard for `none`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iOS screenshots show inputMode="numeric" (number pad) and inputmode="search" (period and Go), and the phone pad and URL keyboard only through type="tel" and type="url"; none shows inputMode="decimal", "email" or "none". spec:AST-013 FR10 asks for evidence from the actual browser for a claim about a named browser: please attach those iOS observations or cut this list to the cases shown.

Comment on lines +20 to +22
* An absent prop renders no attribute, so the browser keeps its own default:
* on iOS a field capitalizes sentences and corrects words, except password,
* email and url fields, which do neither.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The autoCapitalize docs were narrowed to what the screenshots show, but this header still says password and email fields neither capitalize nor correct on iOS, and that every other field corrects words; no iOS screenshot shows those cases. Please narrow it the same way or attach the observations (spec:AST-013 FR10).

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new keyboard-trait props and type values match the current TextInput and TextArea specs, and fields that set none of them render exactly as before. One change is still needed: two comments in packages/core/src/Field/textEntryTraits.ts describe iOS behavior that the iOS screenshots in the description don't show, namely the InputMode comment (lines 44-48) for decimal, email, url, tel and none, and the file header (lines 21-23) for password and email fields. Please narrow both to what the screenshots show, as the .doc.mjs entries already are, or add iOS Safari evidence for those cases.

[Automated review]

@vjeux
vjeux force-pushed the uikit/c08-text-traits branch from 941d194 to 3e22601 Compare November 2, 2026 04:51
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Both narrowed in 3e22601 to what the iOS screenshots show:

  • InputMode: only numeric (the number pad) and, on iOS, search (the web-search keyboard with a period key and Go whatever enterKeyHint says, as the Return-key matrix shows). The decimal, email, url, tel and none claims are gone.
  • File header: an unset prop keeps the browser's default, which on iOS capitalizes sentences except in a URL field, as the .doc.mjs entries say. The password and email claims are gone.

The head also rebases onto main through #9429, which changed these files' imports.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new keyboard props and type values match the current TextInput and TextArea specs, and fields that set none of them render exactly as before. One fix remains: the enterKeyHint docs say Chrome for Android shows Go on a form's last field when no hint is set, but none of the Android screenshots shows that case, so either drop that clause (in Field/textEntryTraits.ts and both enterKeyHint entries in TextInput.doc.mjs) or add an Android frame of it.

[Automated review]

Comment on lines +35 to +36
* key; with no hint, a single-line field's key reads Next while another field
* follows and Go on the last one, a multi-line field's keeps Return, and a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Android frames in the description show Next for a field with no hint, and Go only for a type="url" field with enterKeyHint="go" that is last; none shows a no-hint field last in its form. spec:AST-013 FR10 asks for evidence from the named browser, so either drop "and Go on the last one" here and in both enterKeyHint entries of TextInput.doc.mjs, or add that Android frame.

@vjeux
vjeux force-pushed the uikit/c08-text-traits branch from 3e22601 to cc72ec6 Compare November 2, 2026 05:19
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Dropped in cc72ec6: the no-hint "Go on the last one" clause is gone from Field/textEntryTraits.ts and from both enterKeyHint entries in TextInput.doc.mjs. What remains is what the Android frames show: Next for a field with no hint that another field follows, Next for a type="url" field with go that another field follows, and Return in a TextArea.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to approve: the new keyboard props and type values match the current TextInput and TextArea specs, fields that set none of them render exactly as before, and the iOS and Android notes left in the docs now match the screenshots in the description. Because the pull request also edits the two component specs, the repository's spec gate still waits for an engineering owner (you can do this as one) to comment /approve-spec with the full head SHA, and CI has not run yet on this draft.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to approve: the new keyboard props and type values match the current TextInput and TextArea specs, fields that set none of them render exactly as before, and the tests, the two Chromium touch specs and the iOS and Android screenshots back every claim. One optional cleanup: the new file header in Field/textEntryTraits.ts runs well past the repository's 12-line header guideline and repeats the props' JSDoc, so it can be trimmed. Merging still needs an engineering owner's /approve-spec for this head, since the pull request edits two spec records.

[Automated review]

Comment on lines +13 to +22
* A touch keyboard reads these traits from the focused element: which keys it
* shows (`inputmode`), what its Return key says (`enterkeyhint`), whether it
* capitalizes (`autocapitalize`) and corrects (`autocorrect`) as you type, and
* whether misspellings are underlined (`spellcheck`). On iOS Safari each
* attribute becomes the matching UIKit text-input trait (`keyboardType`,
* `returnKeyType`, `autocapitalizationType`, `autocorrectionType`,
* `spellCheckingType`).
*
* An absent prop renders no attribute, so the browser keeps its own default:
* on iOS a field capitalizes sentences, except a URL field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this header runs 26 lines, past the about-12-line file-header limit in the source-comment guidance, and lines 21-22 repeat the TextEntryTraitProps JSDoc. Keep @file, @input, @output, @position and SYNC: and drop lines 13-22, or move the first paragraph into the TextEntryTraitProps JSDoc as: "A touch keyboard reads these traits from the focused element. An absent prop renders no attribute, so the browser keeps its own default."

component:TextInput FR16, AR6 and DEC-1; component:TextArea FR13. New
props enterKeyHint, inputMode, autoCapitalize and hasAutoCorrect on
TextInput and TextArea, plus hasSpellCheck on TextInput, and the search,
tel and url input types. Each renders the native attribute of the same
name and nothing when unset, so existing fields keep the browser's
defaults; Enter keeps doing what it did whatever the Return key says.

The value types are closed unions exported from the package entry,
EnterKeyHint, InputMode and AutoCapitalize (the HTML-standard values,
off and on included), defined once in Field/textEntryTraits.ts. A public
type test pins each union, types both fields' props with it, and rejects
an arbitrary or unnarrowed string. The Swift contract carries none of the
new props or types, since the Swift field applies none of them yet
(component:swift/TextInput FR6): they are web-only, and `type` projects
onto text, password and email, so the generated Swift is unchanged.

The records' implementation and evidence gaps for these props are closed,
and two Chromium specs check, on a phone viewport with touch emulation,
that the input or textarea a tap focuses carries exactly the attributes
its props set.
@vjeux
vjeux force-pushed the uikit/c08-text-traits branch from d9b0025 to 69264cf Compare November 2, 2026 12:41
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Trimmed in 69264cf: the header keeps @file, @input, @output, @position and SYNC:, and the note that a touch keyboard reads these traits from the focused element, with an absent prop keeping the browser's default, moved into the TextEntryTraitProps JSDoc.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new keyboard props, type values and exported unions match the current TextInput and TextArea specs, fields that set none of them render exactly as before, and the unit, type and Chromium touch tests pass on this head. What remains is the repository's spec-owner gate for the two record edits: an engineering owner, the author included if they are one, records it by commenting /approve-spec followed by the full head SHA.

[Automated review]

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 69264cf

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 2, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 2, 2026 17:50
@cixzhang
cixzhang merged commit ed4b4af into meta:main Nov 2, 2026
107 checks passed
@vjeux
vjeux deleted the uikit/c08-text-traits branch November 2, 2026 18:59

This branch was successfully deployed

1 active deployment
Preview — 69264cf4 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants