Open joelanman opened 1 year ago
I think we may have already resolved this recently! #3773
Hi that link is for the select
element? Was the same thing done for radios and checkboxes?
Ah whoops, no it wasn't, sorry!
Making the same change for checkboxes and radios may be a bit more involved as they each have several more parameters that can slot into the object within items
, but it's not impossible.
I worry a little about maintainability from the user's perspective—if they've used the string array syntax and now decided they want to add hint text to an option, for example, they would need to completely reformat how they're providing data to allow that, which they wouldn't need to do if they were using the object syntax.
Maybe even if we allow an array of strings, it'd be better to have it as a bit of a 'hidden' feature rather than something we encourage the use of.
Related component
Radios and checkboxes
Context
You don't always want different
name
fromtext
, for example when prototyping. An array of strings is a lot simpler than an array of objects. For example:compared to the current approach:
(In this suggestion only
text
is supported - if you want other options likehtml
orhint
you'd have to use the object approach)