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
Can't disable the button immediately after the reset. #6242
Comments
I'm having the same issue. @f0t0n's solution fixes the problem however it would be nice to see this fixed. |
argh how weird, I thought I was becoming crazy, thanks for the workaround. I changed it to using prop() for jQuery 1.6+: setTimetout(function() {
$(".inputSave").prop("disabled", true);
}, 0); A fix would be great indeed. |
if you open a pull request which adds an event i'd be happy to merge it |
@fat Closing a bug report because it needs a fix, it's a weird way to go. It's like saying: there is no bug, unless you can fix it. This is an issue tracker, it's OK to have open issues. Nobody is demanding that you fix them yourself, having an open bug means other people (that are competent enough) can create a PR. |
We are using Bootstrap latest version(3.3.1) and still we are facing this issue. Is this issue not yet fixed? |
Bootstrap 3.3.2 has the same issue. This is NOT CLOSED. It's not just disabling the button, it appears any jQuery method applied to the button after the .button('reset'). For example: btn.button('reset'); Workaround: |
@yahermann That's happening because of #14450. |
This code is not working correctly:
(Fiddle: http://jsfiddle.net/f0t0n/V2ZKY/)
The problem is the
setTimeout
used in theButton.prototype.setState()
method:https://github.com/twitter/bootstrap/blob/master/js/bootstrap-button.js#L46
So I'm forced to use a dirty workaround for this:
(Fiddle: http://jsfiddle.net/f0t0n/BKXVA/)
Therefore It would be great if some event will be triggered from
setTimeout
callback inButton.prototype.setState()
to create an ability to catch the moment when the button can be disabled:Additionally it could be useful if allow user to pass an optional callback to the
setState()
method.So he don't need to observe events if he need to perform some action just once:
The text was updated successfully, but these errors were encountered: