]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
set not-allowed cursor on disabled radio+checkbox labels; fixes #13281
authorChris Rebert <code@rebertia.com>
Thu, 5 Jun 2014 20:31:39 +0000 (13:31 -0700)
committerChris Rebert <code@rebertia.com>
Sat, 7 Jun 2014 00:23:28 +0000 (17:23 -0700)
[skip validator] [skip sauce]

dist/css/bootstrap.css
less/forms.less

index b172acc5b28f2266fa8aebe623ba461729f3bb8b..87855926dc03cb3a3dac45561c06f2048a1e12cb 100644 (file)
@@ -2440,18 +2440,24 @@ input[type="month"].input-lg {
 }
 input[type="radio"][disabled],
 input[type="checkbox"][disabled],
-.radio[disabled],
-.radio-inline[disabled],
-.checkbox[disabled],
-.checkbox-inline[disabled],
+input[type="radio"].disabled,
+input[type="checkbox"].disabled,
 fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"],
-fieldset[disabled] .radio,
+fieldset[disabled] input[type="checkbox"] {
+  cursor: not-allowed;
+}
+.radio-inline.disabled,
+.checkbox-inline.disabled,
 fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox,
 fieldset[disabled] .checkbox-inline {
   cursor: not-allowed;
 }
+.radio.disabled label,
+.checkbox.disabled label,
+fieldset[disabled] .radio label,
+fieldset[disabled] .checkbox label {
+  cursor: not-allowed;
+}
 .input-sm {
   height: 30px;
   padding: 5px 10px;
index cb8a74fa1fb95e831f7f59a416c75100dbceef60..b678d44fc2bcb83b93d8c14c626c5ef7fb83432c 100644 (file)
@@ -247,19 +247,35 @@ input[type="month"] {
 }
 
 // Apply same disabled cursor tweak as for inputs
+// Some special care is needed because <label>s don't inherit their parent's `cursor`.
 //
 // Note: Neither radios nor checkboxes can be readonly.
 input[type="radio"],
-input[type="checkbox"],
-.radio,
+input[type="checkbox"] {
+  &[disabled],
+  &.disabled,
+  fieldset[disabled] & {
+    cursor: not-allowed;
+  }
+}
+// These classes are used directly on <label>s
 .radio-inline,
-.checkbox,
 .checkbox-inline {
-  &[disabled],
+  &.disabled,
   fieldset[disabled] & {
     cursor: not-allowed;
   }
 }
+// These classes are used on elements with <label> descendants
+.radio,
+.checkbox {
+  &.disabled,
+  fieldset[disabled] & {
+    label {
+      cursor: not-allowed;
+    }
+  }
+}
 
 
 // Form control sizing