How do I stop a button from getting smaller when I press it? This is the code for a button (both for the lightning:button & button):

<lightning:button label="{!v.loginButtonLabel}" variant="brand"  class="sfdc_button" onclick="{!c.handleLogin}" />

<button class= "slds-button" onclick="{!c.onClickStep2}">
                                                        Forgot your password?

Edit: More specific, does someone has example css to stop a button to shrink when you press it.

  • 1
    I think you are facing this problem due to CSS overriding. Check the browser console for before and after CSS difference. – Saroj Bera Jun 8 '17 at 11:49
  • I did, but I cant figure out what is going wrong. Any experience with this problem? – Ant12345 Jun 8 '17 at 12:39

If the issue does not persists you can try using <ui:button> which has same functionality with same attributes your using in lightning button

  • It is not specific for the lightning button (see edit). – Ant12345 Jun 9 '17 at 7:52
  • Oh so is it happening for even <ui:button>?then i think what you can do inspect on that button and see whether there is any code is running in css which is making it bigger.If that is the case then you should fetch the class in which it is happening and override it in your styles tab in your component page. – Deepak Agarwal Jun 9 '17 at 9:03

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.