From 4fadffa50a4147f159eb59da3d97dc8979c77e84 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 9 Oct 2019 16:32:35 +0800 Subject: [PATCH] fix(Field): incorrect placeholder color when error and disabled (#4666) --- src/field/index.js | 1 - src/field/index.less | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/field/index.js b/src/field/index.js index 8378da89c..0d87e0203 100644 --- a/src/field/index.js +++ b/src/field/index.js @@ -288,7 +288,6 @@ export default createComponent({ arrowDirection={this.arrowDirection} class={bem({ error: this.error, - disabled: this.$attrs.disabled, [`label-${labelAlign}`]: labelAlign, 'min-height': this.type === 'textarea' && !this.autosize })} diff --git a/src/field/index.less b/src/field/index.less index 2bf47fbe7..514062f39 100644 --- a/src/field/index.less +++ b/src/field/index.less @@ -38,7 +38,7 @@ &:disabled { color: @field-input-disabled-text-color; - -webkit-text-fill-color: @field-input-disabled-text-color; + -webkit-text-fill-color: @field-input-disabled-text-color; // fix disabled color in iOS background-color: transparent; opacity: 1; } @@ -117,17 +117,12 @@ } } - &--disabled { - .van-field__control { - color: @field-input-disabled-text-color; - } - } - &--error { .van-field__control { &, &::placeholder { color: @field-input-error-text-color; + -webkit-text-fill-color: @field-input-error-text-color; } } }