question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Confused by the documentation for radios 'conditional'

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joelanmancommented, Aug 7, 2020

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 object

0reactions
joelanmancommented, Jul 15, 2022

just come across this again in my work - conditional is still listed as a string option, and as boolean in checkboxes, both should probably be removed

Read more comments on GitHub >

github_iconTop Results From Across the Web

The logical order of conditionally revealed content as ... - GitHub
The conditionally revealed content appears immediately after the control that reveals it. This means that it's 'mixed up' within the logical order of...
Read more >
Test radio buttons/checkbox in wpv-conditional ... - Toolset
I have 3 radio buttons: Red, Green, Blue and are assigned values 1, 2, ... https://toolset.com/documentation/user-guides/views/conditional- ...
Read more >
An update on the accessibility of conditionally revealed ...
In the radio button and the checkbox components, we offer an option to conditionally reveal fields when the user selects an answer.
Read more >
Configuring Conditional Navigation Buttons - Developer Guides
To configure a button for conditional navigation, you will need to: ... The radio buttons will be placed vertically, as a bulleted list....
Read more >
Conditional routing using Radio buttons: Action tool errors out
You need to leave one disabled and the other enabled in order to work. The text is a bit confusing, I know because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found