RadioGroup lacks `optionAttribute` and `valueAttribute`
davestewart opened this issue · comments
Description
The RadioGroup
component lacks the optionAttribute
and valueAttribute
which Select
and SelectMenu
have, so you're forced to map existing object properties to label
and value
.
Also, in the context of a radio button, perhaps optionAttribute
might be best-called labelAttribute
.
Additional context
I'd be happy to PR this; looks like quick win.
I note that the docs would also need updating.
The RadioGroup
has an optionAttribute
and valueAttribute
props 🤔
https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/RadioGroup.vue#L66-L73
Maybe time for me to book an eye test 😂
Could also be that the Radio props are shown by default on the RadioGroup page and I missed the second tab.
Actually, what it really is, is that the SelectMenu component has a full section on usage objects, but Select and RadioGroup do not:
https://ui.nuxt.com/components/select-menu#objects
I think they should at least mention it's supported, and link to the SelectMenu section for more info.
Want me to PR @benjamincanac ?
The Select
mentions objects at the beginning: https://ui.nuxt.com/components/select#usage and RadioGroup
always takes objects but it does miss the section about value-attribute
indeed.
The sidebar sections are inconsistent too, which is a shame as the API is!
I'll see if I can find some time this week to tweak.