[SalesForce] How to disable Lightning button after click

<aura:attribute name="Likedisable" type="Boolean" default="true" />

 <a onclick="{!c.disable}">

<lightning:button  aura:id="button1" label="button1" value="up" class="thumb" disabled="{!v.Likedisable}">
        <img src="{!$Resource.thumbs + '/like.png'}" width="20" height="20" /> 
    </lightning:button> 
</a>


uprate : function(component, event, helper) {
component.set("v.Likedisable",false);

}

Best Answer

You should be using event.getSource().set("v.disabled", true);

Related Topic