Skip to content

Commit

Permalink
Only disable pointer-events on disabled <a> btns; fixes #16088
Browse files Browse the repository at this point in the history
<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]
  • Loading branch information
cvrebert committed Mar 17, 2015
1 parent f5250d0 commit c26ffd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/css/bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion less/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@
&[disabled],
fieldset[disabled] & {
cursor: @cursor-disabled;
pointer-events: none; // Future-proof disabling of clicks
.opacity(.65);
.box-shadow(none);
}

a& {
&.disabled,
fieldset[disabled] & {
pointer-events: none; // Future-proof disabling of clicks on `<a>` elements
}
}
}


Expand Down

1 comment on commit c26ffd4

@aurel1211
Copy link

@aurel1211 aurel1211 commented on c26ffd4 Sep 19, 2017

Choose a reason for hiding this comment

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

not working for me, How to make not allowed function to work on chrome?

Please sign in to comment.