lightning:inputField does not respect disabled attribute when field type is Lookup
Winter 19 , Summer 18 , Lightning
Last updated 2022-02-15 ·Reference W-5472789 ·Reported By 101 users
In Review
Summary
When a lightning:inputField component sets the attribute disabled=true, the input should become Read Only. However, when the lightning:inputField refers to a Lookup field, it does not become read only and can be edited even if it is disabled.
Repro
Create the following:
Lightning Component:
testDisableLookup.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" >
<lightning:recordEditForm aura:id="LookupTestform"
recordId="003B0000006bHk7IAE"
objectApiName="Contact">
<lightning:spinner aura:id="spinner" variant="brand" size="large" class="slds-hide"/>
<div class="slds-form-element">
<lightning:inputField fieldName="Name" disabled="true" />
<lightning:inputField fieldName="AccountId" disabled="true" />
</div>
</lightning:recordEditForm>
</aura:component>
Lightning App:
LookupApp.app
<aura:application extends="force:slds">
<c:testDisableLookup/>
</aura:application>
Workaround
None at this time
Reported By (101)























Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.