[SalesForce] Set custom placeholder in lightning:recordEditForm

I have a form in Lightning Components written using lightning:recordEditForm. Inside that form I have lightning:inputField which is a lookup. Is it possible to set a custom placeholder in this input?

EDIT:
My lookup field is to object Employee. Therefore, the placeholder generated automatically is 'Search Employee'. I'm wondering if this is possible to change this placeholder.

Best Answer

It seems you cannot provide a custom placeholder text in lookup fields while using lightning:inputField.

Even though the component is rendered as an input type=text with a placeholder attribute you can't override the attribute.

As an example, if I provide something as below:

<lightning:inputField fieldName="AccountId" aura:id="aId"/>

I can see this rendered as below (removed other attributes) with the placeholder attribute in there:

<input id="input-4" type="text" placeholder="Search Accounts..." class="slds-input slds-combobox__input slds-input-has-icon_group-right">

However if I provide the placeholder attribute something as below (the compiler does not complain), but it never works and that the placeholder attribute always had "Search Accounts..." in there and was never overridden.

<lightning:inputField fieldName="AccountId" aura:id="aId" placeholder="My Text"/>