3

I have the following input in my component:

<ui:inputNumber class="slds-input" aura:id="thisInput" value="{!v.thisVal}" change="{!c.inputChange}"/> 

which calls the following controller:

inputChange: function(c, e, h){
    var localId = event.getSource().getLocalId();
    var field=component.find(localId);
    ...
}

Everything was fine for months. Today I started getting the following error:

Something has gone wrong. Action failed: c$MyComponentl$controller$inputChange[TypeError: Cannot read property 'get' of undefined] Failing descriptor: {c$MyComponent$controller$inputChange}. Please try again. Looking at localId, it is returning undefined.

If I switch from an inputNumber to an inputText, there is no issue:

<ui:inputNumber class="slds-input" aura:id="thisInput" value="{!v.thisVal}" change="{!c.inputChange}"/>

Error

<ui:inputText class="slds-input" aura:id="thisInput" value="{!v.thisVal}" change="{!c.inputChange}"/>

Good

Any thoughts as to why this is happening?

1

This is a combination of issues:

  • I am seeing a flurry of access control exceptions in the javascript console:

    WARNING: Access Check Failed! AttributeSet.get(): attribute 'thisVal' of component 'markup://dutchdevde:inputNumberIssue {1:2;a}' is not visible to 'markup://dutchdevde:inputNumberIssue {1:2;a}'. aura_proddebug.js:16420 WARNING: Access Check Failed! AttributeSet.get(): attribute 'thisVal' of component 'markup://dutchdevde:inputNumberIssue {1:2;a}' is not visible to 'markup://dutchdevde:inputNumberIssue {1:2;a}'.

  • a bug in ui:inputNumberLibrary.initialize() that I will notify the team that owns that functionality of.

  • Was this bug in ui:inputNumber resolved? I still face the same issue - when trying to access event.getSource().getLocalId() it throws an exception. After switching to ui:inputText or lightning:input it works. – neff Feb 8 '17 at 10:42

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.