forcedotcom / LightningTestingService

Apache License 2.0
122 stars 35 forks source link

LTS for blur component event #91

Closed vishalsfdc98 closed 5 years ago

vishalsfdc98 commented 5 years ago

Hi,

I have written onblur() function with aura:id="dummyId" inside my tag and trying simulating same by using document.getElementById("dummyId").dispatchEvent(event);

But this is giving error saying "Failed: Cannot read property 'dispatchEvent' of null".

Kindly assist.

diervo commented 5 years ago

You are mixing concepts, aura:id has nothing to do with the DOM. The attribute auraId is used to find components within aura:cmp.find('dummyId').

If you want to search for your lightning input I suggest you use classes, like: .lightningInput or something like that.

As a friendly note, github issues is not the right forum to ask questions about ones particular issues. Use StackOverflow or similar avenue, that way is easier for everybody else to see the issues/reponses