-
-
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
cursor: not-allowed
isn't working on disabled buttons
#16088
Comments
Hi @Ccriativo! You appear to have posted a live example (https://fiddle.jshell.net/f2t9ahqe/show/light/), which is always a good first step. However, according to the HTML5 validator, your example has some validation 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 @Ccriativo! You appear to have posted a live example (https://fiddle.jshell.net/3sq410wk/show/light/), which is always a good first step. However, according to the HTML5 validator, your example has some validation 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.) |
Sorry about that... it was .Net addiction. =) With bootstrap: https://jsfiddle.net/3sq410wk/1/ |
Confirming that the |
Yes, the pointer-events it's breaking the consistency. It's not the case to remove the cursor:not-allowed then? Some people are suprised that, in same form elements, we have different behaviors... |
X-Ref: #15235 |
<a> doesn't support the `[disabled]` attribute, so `a.btn.disabled` simulates it using `pointer-events: none`. However, this is unnecessary for <button>s and <input>s, and also prevents their `[disabled]` cursor from displaying. [skip sauce] [skip validator]
cursor: not-allowed
isn't working on disabled buttons
For what it's worth, I ended up having to write this to make this work: button:disabled {
cursor: not-allowed;
pointer-events: all !important;
} |
Came across this thread and thought I'd post my workaround, which I know will not work in all scenarios. For my usage, the <li class="disabled">
<a href="#">My Link</a>
</li> li.disabled {
cursor: not-allowed;
}
li.disabled a {
pointer-events: none;
} In my brief testing, the pre-existing symptoms persist if the rules are swapped ( |
It may be useful to disable the .btn.disabled {
pointer-events: none;
}
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
cursor: not-allowed;
} |
@aborchew thanks, this worked for me. |
It seems like it'd wider issue in bootstrap, I've used the solution posted in this thread, not the nicest but the fastest: twbs/bootstrap#16088
It seems like it'd wider issue in bootstrap, I've used the solution posted in this thread, not the nicest but the fastest: twbs/bootstrap#16088
The way I solved it for a custom styled material button was to include the asterisk *
|
Reference: |
Sorry for open another issue for a already closed subject, but I'm not pretty sure if it's a expected behavior.
At the newest bootstrap library, we can find this rule:
"
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
pointer-events: none;
cursor: not-allowed;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
}
"
So I assume that bootstrap tried to implement the cursor: not-allowed for disabled buttons, or input's.
I have created two jsfiddles. The only diference between both, is that one has the bootstrap-min.css imported and the other don't.
We can see that when I don't import the bootstrap library, everything works fine and when I import, it doesn't work anymore.
jsfiddle with bootstrap imported: https://jsfiddle.net/3sq410wk/
jsfiddle without bootstap css: https://jsfiddle.net/f2t9ahqe/
The text was updated successfully, but these errors were encountered: