+ Start a Discussion
Aaditya SinghAaditya Singh 

I using lightning:select and option value. and for option list i am getting data from back end.I am assigning selected option to other custom variable. Issue is i am getting double value of selected option in drop down

<lightning:select class="select-auto-width" name="" variant="label-hidden" aura:id="CurrentId" label="{!sector.id}"  onchange="{!c.doMethod}"  value="{!sector.currentName}">
 <option> {!sector.currentName}</option>
 <aura:iteration items="{!v.nameList}" var="var"> 
<option value="{!var.key}"><span class="slds-align_absolute-center">{!var.value}</span></option>
    </aura:iteration>
      </lightning:select>
Best Answer chosen by Aaditya Singh
Aaditya SinghAaditya Singh
I have resolved this issue by creating a another variable which will hold Id of the currentName and put the {!sector.currentName} at name attribute
<lightning:select class="select-auto-width" name="{!sector.currentName}" variant="label-hidden" aura:id="CurrentId" label="{!sector.id}"  onchange="{!c.doMethod}"  value="{!sector.currentNameID}">
<!-- <option> {!sector.currentName}</option>-->
 <aura:iteration items="{!v.nameList}" var="var"> 
<option value="{!var.key}"><span class="slds-align_absolute-center">{!var.value}</span></option>
    </aura:iteration>
      </lightning:select>