inputlookup icon indicating copy to clipboard operation
inputlookup copied to clipboard

Default value disappear when unfocus

Open BeckGHub opened this issue 8 years ago • 4 comments

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

BeckGHub avatar Mar 01 '17 14:03 BeckGHub

Hi Beck, I'm gonna check into this. In the meanwhile could you please share an example of what you are actually doing ?

enreeco avatar Mar 02 '17 09:03 enreeco

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:

screen shot 2017-03-02 at 11 40 09 pm

When I clicked in the input field, then clicked the outside of the input field. The init value disappeared. screen shot 2017-03-02 at 11 40 53 pm

BeckGHub avatar Mar 02 '17 15:03 BeckGHub

Hi @BeckGHub ,

Did you find any solution on this ? I am facing the same issue.

Thanks

LakhanP avatar Apr 18 '17 06:04 LakhanP

Hi @BeckGHub , there was a problem with the locker services. Try with the new update I've just uploaded. E.

enreeco avatar May 08 '17 13:05 enreeco