0106. autocomplete on fields, mapped to each platform's autofill
- Status: Accepted (Mik, 16 Nov 2026)
- Date: 2026-11-15
- Decided by: domain E implementer (internal only)
- Planning item: wave 5, autocomplete
Context
Sign-in and address forms are slow to fill on a phone. The browser, iOS and Android can all offer saved values, but each needs to be told what a field holds, in its own words.
Decision
<input> and <textarea> take autocomplete, one of the HTML autocomplete words the language lists (off, name, given-name, family-name, nickname, email, username, current-password, new-password, one-time-code, tel, street-address, address-line1, address-line2, address-level1, address-level2, postal-code, country, country-name, organization, organization-title, cc-name, cc-number, cc-exp, cc-exp-month, cc-exp-year, cc-csc, bday, url). Written as text, any other word is E0512; bound, its type is the same set (Autocomplete from @duolith/client).
- Web: the
autocompleteattribute. - iOS:
text-content-type, aUITextContentType(current-passwordispassword,one-time-codeisoneTimeCode). - Android:
autofill-hints, anandroidx.autofill.HintConstantshint (one-time-codeissmsOTPCode).
The kit's TextField takes an autocomplete prop and passes it on.
Alternatives considered
| Option | Why not |
|---|---|
Platform words (textContentType) in markup | Three spellings per field, two of them wrong on each platform |
Infer from type | type="email" can be a username, a new address or a contact's address |
Amendment: the shells, and the words Android cannot fill
Proposed (needs Mik), after the review of PR #36.
The first version said "a word one platform has no counterpart for gives it nothing", and no shell read either attribute, so autocomplete did nothing on a phone. Now:
- Android: the shell depends on Lynx's
xelement-inputand registersDuolithInput(native/android/.../DuolithInput.kt) as theinputelement: aLynxUIInputwhoseautofill-hintsprop (its setter generated bylynx-processor) calls the EditText'ssetAutofillHintswithimportantForAutofillYES, or sets NO foroff. Each hint is checked againstandroidx.autofill.HintConstants(AutofillHints.kt, with a JVM test); one it does not know is logged and not sent. - iOS: the Podfile adds
XElementandDuolithViewControllerregistersDuolithInput(native/ios/Sources/DuolithShell/DuolithInput.swift) as theinputUI: aLynxUIInputwhosetext-content-typeprop sets the UITextField'stextContentType(AutofillContentTypes.swift; iOS 17's card and birthday types only on iOS 17). - Words Android has no hint for (nickname, organization, organization-title, cc-name, url): written as text, the native build refuses them with E0519. This is the strictest rule that keeps every other word working: they still build for the web, which knows them, and every other word builds for both phones. A bound value cannot be known when the app is built; the engine reports it with a warning on Android when the field is drawn.
| Option for those five words | Why not |
|---|---|
| Give Android nothing, silently (the first version) | Against the rule that nothing is dropped silently |
| A warning in the native build | A warning lets the build pass with a field Android never fills |
| Refuse them everywhere (E0512) | They work on the web and on iOS; a web-only app would lose them for nothing |
Map them to a near hint (personName for cc-name) | Android would offer the wrong saved value |
Consequences
The shells read the two attributes from Lynx's input. Whether the autofill services then offer values is checked on a device (native/DEVICE-CHECKLIST.md).