You need to sign in to do that
Don't have an account?
Gleb Gawriljuk
Lightning:recordEditForm - prefilling a lookup leads to the field being focused in the frontend
Hey everyone,
we are building a Lightning Component with the user of the lightning:recordEditForm to create a record.
Within this form with have a lookup that we are prefilling in the handleLoa()d method/event:
AM I doing the prefilling of the lookup wrong or how can I stop the component from focusing on the field after it is set by the controller?
Regards,
Gleb
we are building a Lightning Component with the user of the lightning:recordEditForm to create a record.
<lightning:recordEditForm aura:id="input_placementRecordEditForm" recordTypeId="{!v.placementRecordTypeId}" objectApiName="cxsrec__Placement__c" onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" onload="{!c.handleLoad}" onerror="{!c.handleError}"> <lightning:inputField aura:id="gulp_Sales_Consultant__c" fieldName="gulp_Sales_Consultant__c" value="{!v.placement.gulp_Sales_Consultant__c}"/>
Within this form with have a lookup that we are prefilling in the handleLoa()d method/event:
//component.set("v.placement.gulp_Sales_Consultant__c", component.get("v.position").cxsrec__Sales_consultant__c); component.find("gulp_Sales_Consultant__c")[0].set("v.value", component.get("v.position").cxsrec__Sales_consultant__c);However, after the handleLoad() method is run and the field is successfully prefilled, the compontent scrolls down to the fields and the field and the field is focused (highlighted with a blue border).
AM I doing the prefilling of the lookup wrong or how can I stop the component from focusing on the field after it is set by the controller?
Regards,
Gleb