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 usinglightning:inputField
.Even though the component is rendered as an
input type=text
with aplaceholder
attribute you can't override the attribute.As an example, if I provide something as below:
I can see this rendered as below (removed other attributes) with the
placeholder
attribute in there:However if I provide the
placeholder
attribute something as below (the compiler does not complain), but it never works and that theplaceholder
attribute always had "Search Accounts..." in there and was never overridden.