Skip to content
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

Fix #16703. Prevent disabled buttons set to active on click. #16707

Closed
wants to merge 3 commits into from

Conversation

NogsMPLS
Copy link

Resolves #16703. Conditional added in click event to check if the target button has the class of 'disabled'. If it does not have 'disabled' it calls the 'toggle' function. Otherwise, if button has 'disabled' class, toggle does not run.

@twbs-savage
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: e475549
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/68332537

(Please note that this is a fully automated comment.)

@NogsMPLS
Copy link
Author

Any way to kick off savage build test again? Looking at logs and it doesn't seem like the code in the pull request is the cause of the failed test.

Looks like the tunnel to sauce labs was closed in the middle of testing, so a POST couldn't be done and threw an error.

@cvrebert
Copy link
Collaborator

@twbs-savage retry

@cvrebert cvrebert added the js label Jun 25, 2015
@cvrebert
Copy link
Collaborator

Also, the addition of a new unit test is required in order to merge this. See https://github.com/twbs/bootstrap/tree/master/js/tests for some instructions.

@NogsMPLS
Copy link
Author

ah, okay. I'll get started on that then.

@twbs-savage
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: e475549
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/68367644

(Please note that this is a fully automated comment.)

@twbs-savage
Copy link

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 9358008
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/68371775

(Please note that this is a fully automated comment.)

@mike-zorn
Copy link

The cause of #16703 seems to be that this event handler is called (it shouldn't be for disabled buttons) not that this event handler sets the class to active.

@@ -110,6 +110,18 @@ $(function () {
assert.ok($btn.hasClass('active'), 'btn has class active')
})

QUnit.test('should prevent toggle active when disabled btn children are clicked', function (assert) {
assert.expect(2)
var $btn = $('<button class="btn disabled" data-toggle="button">mdo</button>')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please use a checkbox/radio button group here, since that's what the issue is about?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct. I will update this test.

Though I also have am not sure if this is the correct way to solve this PR. I will continue discussion in #16703.

@cvrebert
Copy link
Collaborator

cvrebert commented Jul 2, 2015

We should also add a disabled button to each of the checkbox/radio examples in https://github.com/twbs/bootstrap/blob/master/docs/_includes/js/buttons.html for good measure.

@cvrebert cvrebert added this to the v3.3.6 milestone Jul 2, 2015
@NogsMPLS
Copy link
Author

NogsMPLS commented Jul 2, 2015

Improved tests to include label > input format as well as singular <button/> Also included use case in visual test html file.

I'm unable to get jekyll to install correctly right now on my machine, so I'm unable to properly update documentation.

I will work on twbs/bootlint#292 next to help improve linter for disabled attributes and classes together on an element.

@twbs-savage
Copy link

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 97eb7f6
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/69341134

(Please note that this is a fully automated comment.)

@mdo mdo added the v3 label Nov 15, 2015
@mdo mdo modified the milestones: v3.3.6, v3.3.7 Nov 24, 2015
@cvrebert cvrebert modified the milestones: v3.3.7, v3.3.8 Jul 25, 2016
@mdo
Copy link
Member

mdo commented Sep 5, 2016

Bootstrap 3 is no longer being officially developed or supported.

All work has moved onto our next major release, v4. As such, this issue or pull request is being closed as a "won't fix." For additional help and support, we recommend utilizing our community resources. Thanks for your understanding, and see you on the other side of v4!

<3,
@mdo and team

@mdo mdo closed this Sep 5, 2016
@mdo mdo modified the milestone: v3.3.8 Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants