Onclick not working in lightning components in Edge

We have a community built with custom lightning components and the locker service update is active. The onclick event has been defined on several components. The onclicks are working fine in Chrome, Firefox and IE11.

<a href="" onclick="{!c.updateUser}">Save</a>

There seem to be some issues in MS Edge though. When we click on an element with an onclick defined, we get the following error:

This page has an error. You might just need to refresh it. Error in $A.getCallback() [Unable to get property ‘apply’ of undefined or null reference] Failing descriptor: {markup://aura:html}

We have been testing on 5 different laptops. 3 of them have the error, while the other 2 don’t have the issue in Edge. This was all tested in a Spring 17 sandbox. We also tested on a Winter 17 org with one of the laptops that has the issue and then everything seems to work fine.

Another test we did, was to remove all of the logic within the controller method and just have a console.log in it, but it never reached that point of the code since we didn’t get the log. We also replaced the expression for the onclick with an alert, but that also doesn’t work.

Does anyone have an idea how we can resolve this?

Answer

@svenf I just verified:

test.app:

<a href="" onclick="{!c.updateUser}">Save</a>

testController.js:

({
    updateUser : function(component, event, helper) {
        alert("Updating user!");
    }
})

on a Spring’17 org with Locker activated using Edge and its working flawlessly.

I am using:

Microsoft Edge 38.14393.0.0

Microsoft EdgeHTML 14.14393

Attribution
Source : Link , Question Author : svenf , Answer Author : Doug Chasman

Leave a Comment