0

For both versions (LWC & Aura), the radio group documentation states that if the name attribute is not specified that multiple buttons can be selected. But this functionality does not work for the LWC version. I've tested this in Salesforce's Playground featuring all of the LWC's as well as in my own scratch org. In both cases, I was unable to select multiple buttons.

My component:

<template>
    <lightning-radio-group 
        class="slds-m-bottom_small"
        label={label}
        options={options}
        value={value}
        type="button"
        required={required}
        onchange={handleSelect}>
    </lightning-radio-group>
</template>

From https://developer.salesforce.com/docs/component-library/bundle/lightning-radio-group/documentation

"Set the name attribute to give the same name to each of the radio buttons in the group and ensure that only one button can be selected. If name is not specified, multiple radio buttons can be selected. The elements rendered by the component must have the same name value to form a group of radio buttons."

1
  • 1
    Hi Mitch, welcome to SFSE. Please take a moment to scroll through the tour and read How to Ask. The format here is specific questions and answers, but your post does not contain a question. Could you please edit it to include one? – Adrian Larson Feb 14 '19 at 18:12
1

Thanks for bringing this up. It looks like this is a documentation bug and will be fixed in the near future.

In the meantime, if you need to select more than one option, lightning-checkbox-group is probably a better choice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.