Salesforce

Salesforce

How to call JAVASCRIPT method on Enter key press in Salesforce Lightning component?

Sample Code: Component: <aura:component implements="force:appHostable" > <aura:attribute name="strText" type="String"/> <div class="slds-box slds-theme_default"> <span onkeypress="{!c.callKeyUp}"> <lightning:input label="Enter Text" value="{!v.strText}" /> </span> </div> </aura:component> Component Controller: ({ callKeyUp : function(component, event, helper) ....