From 4495fba799a8c7ccfaed40b97b76111524837b73 Mon Sep 17 00:00:00 2001 From: johnsonwong666 <64689255+johnsonwong666@users.noreply.github.com> Date: Sat, 28 Oct 2023 19:22:40 +0800 Subject: [PATCH] fix(Search): fix search style when has error message (#12385) --- packages/vant/src/search/Search.tsx | 2 +- packages/vant/src/search/index.less | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/vant/src/search/Search.tsx b/packages/vant/src/search/Search.tsx index f70a9dfa2..be779c07b 100644 --- a/packages/vant/src/search/Search.tsx +++ b/packages/vant/src/search/Search.tsx @@ -125,7 +125,7 @@ export default defineComponent({ v-slots={pick(slots, ['left-icon', 'right-icon'])} ref={fieldRef} type="search" - class={bem('field')} + class={bem('field', { 'with-message': fieldAttrs.errorMessage })} border={false} onBlur={onBlur} onFocus={onFocus} diff --git a/packages/vant/src/search/index.less b/packages/vant/src/search/index.less index f7e7a82e8..e4b556272 100644 --- a/packages/vant/src/search/index.less +++ b/packages/vant/src/search/index.less @@ -48,6 +48,11 @@ .van-field__left-icon { color: var(--van-search-left-icon-color); } + + &--with-message { + height: auto; + align-items: flex-start; + } } &--show-action {