fix: input should have correct padding with controlHeight (#45048)

* fix: input should have correct padding with controlHeight

* chore: update snapshot

* chore: update snapshot
This commit is contained in:
MadCcc 2023-09-25 11:44:17 +08:00 committed by GitHub
parent 3ffe70ae4e
commit 54a2df3f53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 3 deletions

View File

@ -1,3 +1,5 @@
import { extendTest } from '../../../tests/shared/demoTest';
extendTest('input');
extendTest('input', {
skip: ['component-token.tsx'],
});

View File

@ -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',

View File

@ -0,0 +1,7 @@
## zh-CN
token debug
## en-US
token debug

View File

@ -0,0 +1,10 @@
import React from 'react';
import { ConfigProvider, Input } from 'antd';
const App: React.FC = () => (
<ConfigProvider theme={{ token: { controlHeight: 28 } }}>
<Input placeholder="Basic usage" />
</ConfigProvider>
);
export default App;

View File

@ -40,6 +40,7 @@ A basic widget for getting the user input is a text field. Keyboard and mouse ca
<code src="./demo/align.tsx" debug>Text Align</code>
<code src="./demo/textarea-resize.tsx" debug>TextArea</code>
<code src="./demo/debug-addon.tsx" debug>debug Pre / Post tab</code>
<code src="./demo/component-token.tsx" debug>debug token</code>
## API

View File

@ -41,6 +41,7 @@ demo:
<code src="./demo/align.tsx" debug>文本对齐</code>
<code src="./demo/textarea-resize.tsx" debug>文本域</code>
<code src="./demo/debug-addon.tsx" debug>debug 前置/后置标签</code>
<code src="./demo/component-token.tsx" debug>debug token</code>
## API

View File

@ -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,