Open GuoXiaoyang opened 4 days ago
Looks like we just need to update the types https://github.com/adobe/react-spectrum/blob/6288d4a3a886a52473d763dde569e0f7fb33d11e/packages/%40react-types/radio/src/index.d.ts#L45
We already support it in the logic it appears https://codesandbox.io/p/sandbox/goofy-lake-l2czh8?file=%2Fsrc%2FApp.js%3A13%2C20
Hi @LFDanLu I want to resolve this issue.
@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.
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