Closed dyc3 closed 5 years ago
We have tried to be careful when it comes to standard attributes. They have intentionally not been used for other purposes. In the case of checkbox value, it is a string in the underlying component.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio https://codepen.io/lee-chase/pen/831dc22f01f0891df0e6d9ebf6c94956
If the radio button, along with other components, allowed the passing of non-string values we would need to either ensure they can be coerced into a string or provide our own value which would affect form usage.
There is also the question as to whether events raised by the component should return the same type.
I believe the correct solution is for you to pass a string and expect a string in return.
Sorry, didn't mean to close. Meant to start a conversation first ;-)
Ah, that makes sense. In that case, I think the better decision would be to leave it as it is.
Detailed description
I have a component that uses radio buttons, and the values are bound to numeric variables. The radio button expects the
value
attribute to be a String, so Vue warns when it's not a string.However, this does not prevent the component I made from working as expected.
bug
Yes,
cv-radio-button
I expected to be able to use the carbon radio buttons with any type of value that normal radio buttons allow.
Steps to reproduce the issue
cv-radio-button
.value
to a variable that is not a string.Additional information