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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hope that Radio and Checkbox will support the Number type #6628

Open
GuoXiaoyang opened this issue Jun 26, 2024 · 3 comments
Open

Hope that Radio and Checkbox will support the Number type #6628

GuoXiaoyang opened this issue Jun 26, 2024 · 3 comments
Labels

Comments

@GuoXiaoyang
Copy link

GuoXiaoyang commented Jun 26, 2024

Provide a general summary of the feature here

I hope that Radio and Checkbox will support the Number type, as they currently only support strings.

馃 Expected Behavior?

The value of RadioGroupProps/RadioProps/CheckboxGroupProps/Checkbox can also support number or number[].

馃槸 Current Behavior

The value of RadioGroupProps/RadioProps/CheckboxGroupProps/Checkbox only support string or string[].
And actually the input tag supports number value. Why not support number?

馃拋 Possible Solution

No response

馃敠 Context

In our development, some data gotten from the server is only number list. These data is hard to be used in RadioGroup or CheckboxGroup component as they had to be transformed to string.

馃捇 Examples

No response

馃Б Your Company/Team

No response

馃暦 Tracking Issue

No response

@snowystinger
Copy link
Member

Looks like we just need to update the types

We already support it in the logic it appears https://codesandbox.io/p/sandbox/goofy-lake-l2czh8?file=%2Fsrc%2FApp.js%3A13%2C20

@LFDanLu LFDanLu added the good first issue Good for newcomers label Jun 26, 2024
@uniqueeest
Copy link

Hi @LFDanLu I want to resolve this issue.

@LFDanLu
Copy link
Member

LFDanLu commented Jun 27, 2024

@uniqueeest go for it! As @snowystinger linked above, it seems like that type needs to be updated to be string | number. Also please take a look at https://react-spectrum.adobe.com/contribute.html for steps you'll need to do before contributing.

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

No branches or pull requests

4 participants