Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

ng-show on md-button #678

Closed
wiwofone opened this issue Nov 18, 2014 · 6 comments
Closed

ng-show on md-button #678

wiwofone opened this issue Nov 18, 2014 · 6 comments
Assignees
Milestone

Comments

@wiwofone
Copy link

I have an ng-show on an md-button. A click on the button triggers a function (with ng-click) which sets the variable that ng-show depends on, effectively hiding the button and showing a couple of other buttons. I.e: a click on the button hides the button itself and shows new buttons.

However, even with the ripple ink effect disabled, the md-button doesn't seem to hide until the ripple (existent or non-existent) has finished its animation. This means that the button isn't hidden immediately, but with a slight delay.

When doing this with regular buttons, the problem does not arise, which leads me to think that the problem is with the md-button directive. How would one go about fixing this? I've included a short gif (with clicks highlighted) to make it easier to understand.

md-button2

@ThomasBurleson
Copy link
Contributor

@wiwofone - very interesting issue. can you provide a plunkr or codepen that demos the issue; a sample app would make it easy for us to confirm a fix.

@wiwofone
Copy link
Author

I hope you don't mind that I used jsFiddle (found a forkable demo I could use easily). I tried to include all relevant parts exactly as it is in my local code, so that you can rule out eventual stupidity from my part.

http://jsfiddle.net/7a0mhzhs/1/

@ThomasBurleson
Copy link
Contributor

@wiwofone - jsFiddle is fine. Thank you.
Forgive me, but what issue is that sample attempting to demonstrate to me?

@wiwofone
Copy link
Author

Like in the gif, if I press "Start" for example, the "Start" button doesn't disappear immediately, but takes half a second or so to disappear. The same applies to every other button, the buttons should disappear as soon as they are pressed, but they "lag" a little bit. I created another fiddle using native buttons, where this problem doesn't occur.

http://jsfiddle.net/xdv4k29v/

@wiwofone
Copy link
Author

I temporarily fixed it by setting transition: display 0 on the buttons. Might be of some help.

@olee
Copy link

olee commented Mar 22, 2016

Hi, I somehow got the exact same issue, however using latest version.
If I exchange the md-button for a simple button, it directly disappears like it's supposed to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants