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

Can't pass a className to RadioGroup #477

Open
GrossDesignCo opened this issue Dec 4, 2024 · 2 comments
Open

Can't pass a className to RadioGroup #477

GrossDesignCo opened this issue Dec 4, 2024 · 2 comments

Comments

@GrossDesignCo
Copy link

GrossDesignCo commented Dec 4, 2024

Describe the bug

generic components Radio & RadioGroup are missing handling for className in userProps.

Likely low-priority since most folks use custom components but nice to have :)

Working example in Input
CleanShot 2024-12-03 at 16 06 06

Compare to RadioGroup
CleanShot 2024-12-03 at 16 08 06

To Reproduce

Repro: https://codesandbox.io/p/sandbox/keen-sound-h6zk5d

@joepuzzo
Copy link
Collaborator

Hmm where would you expect the class to end up ?

@GrossDesignCo
Copy link
Author

In the default/native inputs case I'd expect the className to get applied to the fieldset for RadioGroup. For Radio it's a bit more debatable, but I think the most useful would be on the label since that wraps the input.

As a rule of thumb on TDS we'd try to put the className on the outermost element within the component's markup, and if necessary add another prop like inputProps (maybe inputElementProps or something in this case) so that it was easy to target for folks.

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

No branches or pull requests

2 participants