Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: input should have correct padding with controlHeight #45048

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/input/demo/component-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## zh-CN

token debug

## en-US

token debug
10 changes: 10 additions & 0 deletions components/input/demo/component-token.tsx
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions components/input/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions components/input/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion components/input/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down