Confused by the documentation for radios 'conditional'
See original GitHub issueI was trying to use the conditional option on radios.
I saw that the example used
conditional:{
html:"<p> ...
I didn’t need html, just a sentence so I thought I could use text
instead of html
as you can in other places in Frontend. However, I tried it and it didn’t work - there’s no text option here.
When I re-read the docs, I misread and thought the ‘conditional’ option, being a string, could just accept text.
However, I misread it, that doesn’t work - the docs actually say:
conditional | string | If true, content provided will be revealed when the item is checked.
But I don’t think this is correct? In the examples, conditional
is not a string, it’s an object with only one property - html
I wonder if this might be better as two options:
conditionalHTML
and conditionalText
This would avoid another object, and be more consistent with the use of HTML and text elsewhere?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
It was radios I was looking at:
https://design-system.service.gov.uk/components/radios/
I would say even
boolean
is a bit confusing, as the examples don’t use a boolean, they use an objectjust come across this again in my work -
conditional
is still listed as astring
option, and asboolean
in checkboxes, both should probably be removed