Skip to content

feat(RadioGroup): add autocomplete prop and disable browser autofill on the hidden input - #2198

Merged
huntabyte merged 6 commits into
huntabyte:mainfrom
anastasiia-baboshina:fix/radio-group-hidden-input-autocomplete
Oct 20, 2026
Merged

huntabyte merged 6 commits into
huntabyte:mainfrom
anastasiia-baboshina:fix/radio-group-hidden-input-autocomplete

Conversation

@anastasiia-baboshina

Copy link
Copy Markdown

Closes #2152.

Problem

RadioGroup.Root renders a hidden text input when name is set. In a form with fields that the browser autofills (name, email, ...), Chrome can also fill this hidden input with a random string that doesn't match any radio item, and the user can't see it because the visible selection doesn't change.

Change

Tests

Added two browser tests: the hidden input has autocomplete="off" by default, and the prop is forwarded when set. Ran the RadioGroup browser suite in Chromium: 34 passed; without the source change the two new tests fail. prettier, oxlint, eslint and svelte-check (bits-ui package) are clean. WebKit and the docs type check were not run locally.

Question

Select.Root forwards autocomplete with no default, while here I made it default to off as the issue suggests. If you'd rather keep the default undefined and only expose the prop, it's a one-line change.

This PR was prepared with the help of Claude Code. The issue was reproduced from the report and the result checked locally.

@changeset-bot

changeset-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 369a439

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
bits-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview da528e7

@huntabyte
huntabyte merged commit 3c70c53 into huntabyte:main Oct 20, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 20, 2026

This branch was successfully deployed

1 active deployment
Preview — 369a4396 Deployed Oct 20, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable browser autocomplete for RadioGroup input

2 participants