-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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 button group radio item is selectable in 3.3.5 js #16703
Comments
Hi @NogsMPLS! You appear to have posted a live example (https://fiddle.jshell.net/k6a3j46o/28/show/light/), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
Hi @NogsMPLS! You appear to have posted a live example (https://fiddle.jshell.net/k6a3j46o/27/show/light/), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
Updated fiddles - |
What browser and OS are you using? |
Windows 7, reproduced in Chrome and Firefox |
I found that even just a disabled button will still send click events in 3.3.5 (Chrome OSX) 3.3.4 (expected behavior: no alert opens on click) |
hmmm...good point, my pull request just prevents the toggle from running, but it appears that what really needs to happen is a setting state to disabled. You'll notice that the 'Loading...' button, when set to disabled is properly disabled. I'll see if I can come up with a good solution for this. |
I'd guess this has something to do with c26ffd4. If you add |
Huh, interesting. That does seem like the main issue. Annoying this is though, putting pointer-event:none back into the css makes the 'No Action' symbol on hover go away, as hover is a pointer-event. |
@ApeChimp, you're test with the button element specifically can be solved by adding the 'disabled' attribute, alongside the disabled class to the button: http://jsfiddle.net/b4kgw6vn/2/ This however does not fix the |
yeah, I don't think label elements are allowed to be truly 'disabled'. This might be a bigger issue in how bootstrap handles disabling checkbox and radio buttons. The best solution so far is setting I believe that to be a more than fair trade off in order to keep consistent functionality. |
@ApeChimp When using an actual
|
Ahhhh, thanks, @cvrebert. Sorry for hijacking this issue. |
Confirmed via https://jsfiddle.net/Ldh1fzcj/1/ that this is a valid bug in the button.js plugin's checkbox/radio widget. |
I'm not sure if my pull request #16707 correctly solves the core problem. All the pull request will do is prevent the Past versions seem to have relied on For reference, this fiddle shows that disabled class, combined with disabled attribute and the I suppose we could also prevent Thoughts? If people agree, I can get a PR up tonight/tomorrow. |
i will note that a downside to my suggestion is that |
I think it should be possible to avoid relying on |
okay, well, in that case, we can definitely prevent And we can prevent tabbing to the element by making sure disabled class and disabled attribute are together on the same element. But what it will NOT do is prevent any inline onClicks from firing. Other than somehow unbinding or calling I think we'd just have to say something in documentation that states that disabled will prevent bootstrap js events from firing on the element, but any custom events are not guaranteed to be prevented. Agree/disagree? |
Not sure if this is implied, but the same issue affects tabs, click event is sent despite .disabled |
Whats the work around for this issue? |
Found this issue today. I've resorted to @NogsMPLS 's solution of "pointer-events: none". It stops the disabled "cursor:not-allowed" class, but until it's fixed, it will have to do for me. |
@geligelu @gviswanathan I've just discovered this issue and after some experimentation I've found that hooking into the click event for the label and returning false if the disabled attribute exists works well for me. Example:
|
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, |
Is this for real? bootstrap v4 is still alpha, and the production version (v3) is not supported anymore? |
bump |
@karolyi this is for reals. You may google futhrer if you wish so, this was discussed in plenty of places like Reddit, HackerNews or even here in other tickets. In a nutshell: bugfixes will happen to v3, but getting v4 out the door is priority and maintenance burden for v3 has proven to be too time consuming. |
@mdo erm, bootstrap 4 still alpha and so 3 get's no more bug fixes?! This is a bug. You shouldn't be able to select a disabled field. |
@mdo Great. 4 months later the bug is still open, with 3.3.7 and no fix because hey, one point in the future. Anyone else please use a version with other bugs in 3.3.4 |
"4 months later, and the volunteers working on bootstrap in their spare time still haven't fixed this..." |
Hi, This issue is now re-producable in v4 alpha 6. Temp fix is to add pointer-events: none to .btn.disabled |
It is probably best to revert to bootstrap 3.3.5 then |
Disabling a button group item does not seem to work anymore in 3.3.5. This is using the button.js bootstrap plugin.
Here is a fiddle with 3.3.4:
https://jsfiddle.net/k6a3j46o/28/
Clicking the disabled item does nothing, as expected.
Here is the same fiddle with 3.3.5:
https://jsfiddle.net/k6a3j46o/27/
Clicking the disabled item actually adds .active to the label field, so you end up with an active disabled item. I believe this is not expected behavior.
There seems to be a disconnect on the disabled input's wrapper container behavior and the actual input behavior. I am pretty sure the disabled attribute on the input is correct and will work correctly, but if a label element has the disabled class, it shouldn't be able to add the active class.
This is bug is specifically for the click event I think, as there are still use cases of have an 'active disabled' item given from server or other means, but the user should not be able to select a disabled button group item with the click event as it should be read only.
The text was updated successfully, but these errors were encountered: