When I use ui:inputEmail I get one thing. When I use input type="email" I get another

If I use this code for my input box to take an email address:

<input type="email" onkeyup="{!c.sendSearchKeyChange}"/> 

The event sent to sendSearchKeyChange has a prototype of KeyboardEvent. And, most important to me, I can say event.target.value, and find out the value of the input box.

If I code the input box like this:

<ui:inputEmail keyup="{!c.sendSearchKeyChange}"/> 

The event sent to sendSearchKeyChange has a prototype of just plain Object. And event.target.value is undefined.

I thought the keyup attribute supported by just went straight through to the same place the onkeyup attribute goes to on the regular html element, but I guess not. Is the event that is sent documented somewhere?


To perform what you are trying to do, you just have to make these modifications to your code:

<ui:inputEmail keyup="{!c.sendSearchKeyChange}" updateOn="keyup"/>

    sendSearchKeyChange : function(component, event, helper) {
        var email = event.getSource().get("v.value");

some reference here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ui_inputText.htm https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_client_side_controller.htm

Category: aura Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.224 (s). 12 q(s)