TextInput, EmailInput, PasswordInput, NumberInput, SearchInput, Textarea, Select and Switch render no name and no autocomplete, so they cannot be submitted, read back, or autofilled.
Eight of the ten form-control components emit an <input>/<select>/<textarea> with no name attribute, and none of the ten accepts autocomplete. Only Checkbox and Radio pass name through.
A control without a name is not a form control in the HTML sense: it is excluded from FormData, from form.elements.namedItem(), and from an ordinary non-JS form POST. Any form built from these components silently submits nothing for those fields.
Reproduction
import { processDirectives } from '@stacksjs/stx'
const markup = `<TextInput label="Email" name="email" autocomplete="email" placeholder="you@example.com" helperText="We never share it." />`
const html = await processDirectives(markup, {}, 'probe.stx', {
autoShell: false,
componentsDir: 'node_modules/@stacksjs/components/src/ui',
}, new Set())
console.log(html.match(/<input[^>]*>/)[0])Rendered on @stacksjs/components 0.2.382:
<input
type="text"
id="input-stx_text_input_1_s6690i"
class="block w-full border-0 rounded-control …"
:value="inputValue()"
placeholder="you@example.com"
@input="onInput($event)"
@change="onChange($event)"
aria-describedby="input-stx_text_input_1_s6690i-helper"
/ />name="email" and autocomplete="email" were both passed and neither appears. There is no $attrs-style fallthrough, so a caller has no way to add them.
Why autocomplete matters separately
autocomplete is how a password manager and the browser's own autofill identify a field. PasswordInput with no autocomplete="current-password" is not offered for autofill and is not recognised as a sign-in field. For PasswordInput specifically this is the difference between a usable and an unusable login form.
Two smaller things visible in the same output
- The tag closes as
/ />. A stray slash is emitted alongside the real self-closing one. -style conditional attributes leave blank lines in the output when false. Cosmetic, but it is four empty lines per control.
Suggested fix
Accept and emit name, autocomplete, and ideally form, inputmode and enterkeyhint, on every control that renders a native form element — or add a general attribute fallthrough so callers can supply anything the native element takes. Checkbox/Radio already do the former and can serve as the pattern.
Impact here
This blocks adopting the form-control family across six apps with 175 <input> sites. The components are otherwise in good shape for it — fully role-token based (0 hard-coded palette values, 0 dark:), and they already wire aria-invalid and aria-describedby, which is the gap we have in all 175. The missing name is the only thing standing in the way.
Found on @stacksjs/components 0.2.382 / @stacksjs/stx 0.2.382.