You need to sign in to do that
Don't have an account?
Ken Fitzpatrick 10
Having trouble with Lightning:Input Type="Radio" defaulting to the right button
I am building a group of radio buttons using an Aura:Iteration and Lightning:Input Type="Radio". I am setting checked to true on the default option for a particular profile. The one I want to check is being checked, but the first radio button is still highlighted. I am trying to figure out how to highlight the checked option instead of the first or at least just unhighlight the first.
Here is a screenshot showing what I am talking about:
You can see the first option is highlighted, not the checked option.
I tried to use a Lighting:RadioGroup, but I can't get the descriptions below each option in a radio group, so I decided on the iteration and input. Here is my markup:
Thanks in advance!
Here is a screenshot showing what I am talking about:
You can see the first option is highlighted, not the checked option.
I tried to use a Lighting:RadioGroup, but I can't get the descriptions below each option in a radio group, so I decided on the iteration and input. Here is my markup:
<aura:iteration items="{!v.recordTypes}" var="rType" indexVar="idx"> <lightning:input aura:id="rType_{!idx}" name="rTypeRadioGroup" type="radio" label="{!rType.name}" checked="{!rType.selected}" onchange="{!c.radioSelected}"/> <div class="slds-p-left_large"> <div class="slds-p-left_large slds-text-heading_small"> {!rType.description} </div> </div><br /> </aura:iteration>Any ideas?
Thanks in advance!
Have you tried using the Focus method for lightning: input. Add this below line in your controller when you are marking a radio button True.
Let me know if it works. If it does please mark this as the best answer so it will be helpful to others.
Thanks and Regards
Ayush Sharma