[SalesForce] lightning-radio-group not allowing multiselect

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."

Best Answer

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.

Related Topic