-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disabled buttons with icons #3159
Comments
I guess this is specific to my implementation as I inject elements dynamically. Seems like the only way around it is to prevent propagation manually ala $(':disabled i').on('click', false); |
Can you explain why you think this is specific to your implementation? I'm experiencing the same thing and your fiddle example seems to indicate it doesn't have anything to do with dynamic element injection? |
I realized that this is not specific to my implementation and am including that code snippet above to fix that in my app. |
This should be reopened I'm having the same issue -- no dynamic injection at all. When clicking on an icon that is in a disabled button the click event goes through. |
Adding the code snippet above is the solution. They've made it pretty clear that the disabled class is just for aesthetics and it's up to you to handle clicks. (Source: http://twitter.github.com/bootstrap/base-css.html#buttons) |
There's:
I agree the prior would be an aesthetic thing but the latter should function like any disabled button should, and not be clickable. Placing icons within the button breaks this. |
The jQuery solution above won't work if View is created/rendered after page load, but you can add this to your view: |
Disabled buttons with icons act weirdly in that clicking on the button doesn't do anything but clicking on the icon within the disabled button triggers the click event on the disabled button.
In this example, clicking around the envelope but within the button does nothing, as expected.
But, clicking on the envelope triggers the click event.
http://jsfiddle.net/blissfulignant/Rypse/5/
The text was updated successfully, but these errors were encountered: