2

I made look up search with lightning:inputField.

search is available, but I want to change its placeholder.

look up search field

I mean that I want to set some text instead of '001'.

<lightning:inputField fieldName="SAMPLEOBJECT__c" value="{!v.SearchResult}" aura:id="lookup"/>

I tried component.find('lookup').get("v.value") and component.get("v.SearchResult"), but both of these returns id of items.

Is it possible?

1

It seems impossible to change the text of placeholder. @jayanta Das has answered here why you can't: Set custom placeholder in lightning:recordEditForm

Apart from that, I tried changing it using CSS. But it seems it allows me to change the style of placeholder text but the text itself.

.THIS ::placeholder {
    color:red;
    content:'replacement string';
}
.THIS :placeholder-shown{
    content:'replacement string';
}
| improve this answer | |
  • Hmm, I wanted to change the placeholder of "search result", but not "search field". But it seems difficult… – Hayato Oct 1 '19 at 0:56
  • I was trying to use design token overrides, this is much much easier. Thank you! – Shane Aug 4 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.