From f42d0667c8637d983f840c63c56fa2ab31e42911 Mon Sep 17 00:00:00 2001 From: JiaQi <112228030+Yuiai01@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:06:28 +0800 Subject: [PATCH] fix(Autocomplete): internal input cannot apply fontFamily (#45197) --- components/select/style/single.tsx | 2 +- components/style/index.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/select/style/single.tsx b/components/select/style/single.tsx index f4bb97807d..93ce26866a 100644 --- a/components/select/style/single.tsx +++ b/components/select/style/single.tsx @@ -19,7 +19,7 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { // ========================= Selector ========================= [`${componentCls}-selector`]: { - ...resetComponent(token), + ...resetComponent(token, true), display: 'flex', borderRadius, diff --git a/components/style/index.ts b/components/style/index.ts index 43a975d37d..06c28d921c 100644 --- a/components/style/index.ts +++ b/components/style/index.ts @@ -11,7 +11,10 @@ export const textEllipsis: CSSObject = { textOverflow: 'ellipsis', }; -export const resetComponent = (token: DerivativeToken): CSSObject => ({ +export const resetComponent = ( + token: DerivativeToken, + needInheritFontFamily = false, +): CSSObject => ({ boxSizing: 'border-box', margin: 0, padding: 0, @@ -21,7 +24,7 @@ export const resetComponent = (token: DerivativeToken): CSSObject => ({ lineHeight: token.lineHeight, listStyle: 'none', // font-feature-settings: @font-feature-settings-base; - fontFamily: token.fontFamily, + fontFamily: needInheritFontFamily ? 'inherit' : token.fontFamily, }); export const resetIcon = (): CSSObject => ({