Lightning ui:InputText details

This post is primarily directed towards Salesforce Lightning Development

We have ui input component as

<ui:inputText aura:id=”searchInput” label=”Search” keyup=”{!c.performSearch}”/>

and following function
performSearch: function(component, event, helper) {
var searchInput = component.find(“searchInput”);
var searchValue = searchInput.get(“v.value”);

now, if you type “ABCD” in the rendered html input of above component, then function performSearch will be called 4 times owing to keyup event, but the var searchValue will contain undefined, because v.value is not updated on keyup, its updated on ‘change’ event by default

Change event is fired when focus goes out of the input box

in order to make v.value update on key up modify above component as follows

<ui:inputText aura:id=”searchInput”
updateOn=”keyup” />


I love learning