1

It's really strange to say that, but I don't know why this was working on the last week and now it's not working anymore. I tried different browsers and OS, but it simply doesn't work.

Here is the .cmp

<aura:component >
    <ui:inputDate aura:id="date-id" displayDatePicker="true" select="{!c.fldChanged}"/>
</aura:component>

Here is the controller (.js)

({
    fldChanged : function(component, event, helper) {
        alert('hi');
    }
})

I tried other supported events (as described here), and if I change it from 'select' to 'blur' (for example), the event is fired normally.

Has anyone faced this issue?

Thanks in advance!

0

I had the same issue with locker service turned on. I worked around it by adding a change handler on the value tag of the date picker instead of using the change or select event.

Markup

 <ui:inputDate aura:id="date-id" value='{!v.date}' displayDatePicker="true"/>   

Change Handler

  <aura:attribute name="date" type="Date"/>
<aura:handler name="change" value="{!v.date}" action="{!c.fldChanged}"/> 

Controller code:

 fldChanged : function(component, event, helper) {
        alert('hi');
    }
1
  • That looks good, but in my real case I have like a list of <ui:inputDate> (since it's inside of an <aura:iteration>, ) do you know how to handle this on that case? I mean, the value will not be only a simple variable, it could be related to the ui:inputDate that I decide to change.. Thanks!
    – msonza
    Jul 7 '17 at 16:32
0

The select event is not meant for inputDate it seems. You can use change event instead. See the image below. enter image description here

4
  • Yeah, if I have only 1 input:Date that may work, but on my real scenario, I have like a list of it and need to handle it with values that are filled dinamically. Is there a way to create something like that? Still, I don't understand why this is was working before and now it's simply broken.
    – msonza
    Jul 10 '17 at 17:13
  • Did you try with "change" event ? Jul 12 '17 at 3:54
  • If there is only a single record (only one input:date) it works, but on my real case, I have more than one. So what can I do? Do you have any suggestions? (As I said above, they are dinamically created and have different results, so I cannot create like 10 "change" events or so.)
    – msonza
    Jul 12 '17 at 13:47
  • Why do you want to create 10 change events ? You can put it in aura:iteration and do it right ? Jul 14 '17 at 8:29
0

Just for the record, this is a known error and it's being verified here.

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.