From 54a2df3f5347dca18a17e75808c4c5d919e09581 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Mon, 25 Sep 2023 11:44:17 +0800 Subject: [PATCH] fix: input should have correct padding with controlHeight (#45048) * fix: input should have correct padding with controlHeight * chore: update snapshot * chore: update snapshot --- components/input/__tests__/demo-extend.test.ts | 4 +++- components/input/__tests__/demo.test.tsx | 4 +++- components/input/demo/component-token.md | 7 +++++++ components/input/demo/component-token.tsx | 10 ++++++++++ components/input/index.en-US.md | 1 + components/input/index.zh-CN.md | 1 + components/input/style/index.ts | 2 +- 7 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 components/input/demo/component-token.md create mode 100644 components/input/demo/component-token.tsx diff --git a/components/input/__tests__/demo-extend.test.ts b/components/input/__tests__/demo-extend.test.ts index 0493994f25..9d9d44e777 100644 --- a/components/input/__tests__/demo-extend.test.ts +++ b/components/input/__tests__/demo-extend.test.ts @@ -1,3 +1,5 @@ import { extendTest } from '../../../tests/shared/demoTest'; -extendTest('input'); +extendTest('input', { + skip: ['component-token.tsx'], +}); diff --git a/components/input/__tests__/demo.test.tsx b/components/input/__tests__/demo.test.tsx index 999fcbc451..99446ad6fe 100644 --- a/components/input/__tests__/demo.test.tsx +++ b/components/input/__tests__/demo.test.tsx @@ -1,7 +1,9 @@ import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; -demoTest('input'); +demoTest('input', { + skip: ['component-token.tsx'], +}); rootPropsTest( 'input', diff --git a/components/input/demo/component-token.md b/components/input/demo/component-token.md new file mode 100644 index 0000000000..cb27cfb5e2 --- /dev/null +++ b/components/input/demo/component-token.md @@ -0,0 +1,7 @@ +## zh-CN + +token debug + +## en-US + +token debug diff --git a/components/input/demo/component-token.tsx b/components/input/demo/component-token.tsx new file mode 100644 index 0000000000..c136db490f --- /dev/null +++ b/components/input/demo/component-token.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { ConfigProvider, Input } from 'antd'; + +const App: React.FC = () => ( + + + +); + +export default App; diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index b91c5c005a..ea4618290c 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -40,6 +40,7 @@ A basic widget for getting the user input is a text field. Keyboard and mouse ca Text Align TextArea debug Pre / Post tab +debug token ## API diff --git a/components/input/index.zh-CN.md b/components/input/index.zh-CN.md index adc0b5d88b..6a4c9926fc 100644 --- a/components/input/index.zh-CN.md +++ b/components/input/index.zh-CN.md @@ -41,6 +41,7 @@ demo: 文本对齐 文本域 debug 前置/后置标签 +debug token ## API diff --git a/components/input/style/index.ts b/components/input/style/index.ts index dc5d9da876..feb58728ad 100644 --- a/components/input/style/index.ts +++ b/components/input/style/index.ts @@ -1032,7 +1032,7 @@ export const initComponentToken = (token: GlobalToken): SharedComponentToken => return { paddingBlock: Math.max( Math.round(((controlHeight - fontSize * lineHeight) / 2) * 10) / 10 - lineWidth, - 3, + 0, ), paddingBlockSM: Math.max( Math.round(((controlHeightSM - fontSize * lineHeight) / 2) * 10) / 10 - lineWidth,