Skip to content

Commit 4fadffa

Browse files
authored
fix(Field): incorrect placeholder color when error and disabled (youzan#4666)
1 parent a18a9c5 commit 4fadffa

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/field/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ export default createComponent({
288288
arrowDirection={this.arrowDirection}
289289
class={bem({
290290
error: this.error,
291-
disabled: this.$attrs.disabled,
292291
[`label-${labelAlign}`]: labelAlign,
293292
'min-height': this.type === 'textarea' && !this.autosize
294293
})}

src/field/index.less

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
&:disabled {
4040
color: @field-input-disabled-text-color;
41-
-webkit-text-fill-color: @field-input-disabled-text-color;
41+
-webkit-text-fill-color: @field-input-disabled-text-color; // fix disabled color in iOS
4242
background-color: transparent;
4343
opacity: 1;
4444
}
@@ -117,17 +117,12 @@
117117
}
118118
}
119119

120-
&--disabled {
121-
.van-field__control {
122-
color: @field-input-disabled-text-color;
123-
}
124-
}
125-
126120
&--error {
127121
.van-field__control {
128122
&,
129123
&::placeholder {
130124
color: @field-input-error-text-color;
125+
-webkit-text-fill-color: @field-input-error-text-color;
131126
}
132127
}
133128
}

0 commit comments

Comments
 (0)