[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RadioGroup] disabled prop has no effect #3851

Open
kripod opened this issue Jun 1, 2024 · 0 comments
Open

[RadioGroup] disabled prop has no effect #3851

kripod opened this issue Jun 1, 2024 · 0 comments

Comments

@kripod
Copy link
kripod commented Jun 1, 2024

Current behavior

When specifying the disabled prop on RadioGroup, it doesn’t have any effect on the underlying Radio children, nor the wrapper element itself.

Steps to reproduce the bug

  1. Open https://stackblitz.com/edit/ariakit-unmdg3?file=src%2FApp.tsx
  2. Observe disabled having no effect on the DOM subtree RadioGroup renders

The inline JSDoc isn’t clear enough about the disabled prop of RadioGroup, as it turns out focusable shall be set for the former to have an effect.
Image of JSDoc shown in IDE, lacking information about having to set `focusable` on `RadioGroup`

Expected behavior

The disabled prop of a RadioGroup should possibly disable all the Radio components within, either:

  • On a one-by-one basis using context
  • Making RadioGroup a fieldset by default and applying the disabled prop on it

Workaround

Use a render prop as follows:

<RadioGroup render={(props) => <fieldset disabled={disabled} {...props} />}>
  {children}
</RadioGroup>

Possible solutions

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants