2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

Fixes #8159: Be more specific about disabled inputs to avoid iOS bug

Attached disabled styles to the exact input types rather than all
inputs and reseting the checkbox/radios. If setting `background-color:
transparent;`, iOS renders no background on the disabled control.
This commit is contained in:
Mark Otto
2013-06-20 17:02:10 -07:00
parent 90d4343f66
commit 82f9de9459
2 changed files with 63 additions and 51 deletions
+11 -29
View File
@@ -72,6 +72,17 @@ input[type="color"] {
outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
}
// Disabled and read-only inputs
// Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
// disabled if the fieldset is disabled. Due to implementation difficulty,
// we don't honor that edge case; we style them as disabled anyway.
&[disabled],
&[readonly],
fieldset[disabled] & {
cursor: not-allowed;
background-color: @input-bg-disabled;
}
}
// Reset appearance properties for textual inputs and textarea
@@ -241,35 +252,6 @@ input[type="color"] {
}
// DISABLED STATE
// --------------
// Disabled and read-only inputs
// Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
// disabled if the fieldset is disabled. Due to implementation difficulty,
// we don't honor that edge case; we style them as disabled anyway.
input,
select,
textarea {
&[disabled],
&[readonly],
fieldset[disabled] & {
cursor: not-allowed;
background-color: @input-bg-disabled;
}
}
// Explicitly reset the colors here
input[type="radio"],
input[type="checkbox"] {
&[disabled],
&[readonly],
fieldset[disabled] & {
background-color: transparent;
}
}
// FORM FIELD FEEDBACK STATES
// --------------------------