inputlookup
inputlookup copied to clipboard
Default value disappear when unfocus
Hi Enreeco,
Thanks for your sharing input lookup component.
I have used the input lookup component in a lightning component with multiple input lookup field. But my issue is that: When I have an init value in an input lookup component, then focus the input lookup component, and then unfocus. The init value in the input lookup component disappeared.
Something I need to pay attention to?
Thanks in advance. Beck
Hi Beck, I'm gonna check into this. In the meanwhile could you please share an example of what you are actually doing ?
Hi Enreeco, Thanks for your response.
I did a test in a single app:
TestLightningApp:
<aura:application extends="force:slds">
<c:CustomTestCmp recordId="a3j4C000000GoKjQAK"/>
</aura:application>
CustomTestCmp.cmp:
<aura:component controller="TestApexController" implements="force:hasRecordId" >
<aura:attribute name="clientApp" type="ClientApplication__c" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<div class="slds-is-relative">
<div class="slds-section slds-is-open" style="margin-top:30px;">
<c:InputLookup type="Contact" value="{!v.clientApp.Contact__c}" className="form-control "/>
</div>
</div>
</aura:component>
CustomTestCmpController.js:
doInit : function(component, event, helper) {
var action = component.get("c.getClientApplication");
action.setParams({"caId": component.get("v.recordId")});
action.setCallback(this, function(response) {
var state = response.getState();
if(component.isValid() && state === "SUCCESS") {
component.set("v.clientApp", response.getReturnValue());
}
});
$A.enqueueAction(action);
}
TestApexController.cls:
public with sharing class TestApexController
{
@AuraEnabled
public static ClientApplication__c getClientApplication(Id caId)
{
ClientApplication__c clientApp = [select Id, Name, Contact__c from ClientApplication__c where Id = :caId limit 1];
return clientApp;
}
}
When I view the test application, it worked and had an init value:
When I clicked in the input field, then clicked the outside of the input field. The init value disappeared.
Hi @BeckGHub ,
Did you find any solution on this ? I am facing the same issue.
Thanks
Hi @BeckGHub , there was a problem with the locker services. Try with the new update I've just uploaded. E.