fix(input): border-radius issue with addonAfter in compact mode (#52490)

* fix: border-radius issue with `addonAfter` in compact mode

* chore: add demo

* chore: update  snapshot
This commit is contained in:
DDDDD12138 2025-01-20 16:10:47 +08:00 committed by GitHub
parent f50a8e6175
commit 0d51109c2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 82 additions and 0 deletions

View File

@ -642,6 +642,14 @@ const genGroupStyle: GenerateStyle<InputToken> = (token: InputToken) => {
borderEndEndRadius: 0,
},
},
// Fix the issue of input use `addonAfter` param in space compact mode
// https://github.com/ant-design/ant-design/issues/52483
[`&:not(${componentCls}-compact-first-item)${componentCls}-compact-item`]: {
[`${componentCls}-affix-wrapper`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0,
},
},
},
},
};

View File

@ -9377,6 +9377,41 @@ exports[`renders components/space/demo/compact.tsx extend context correctly 1`]
</div>
</div>
</div>
<div
class="ant-space-item"
>
<div
class="ant-space-compact"
>
<button
class="ant-btn ant-btn-primary ant-btn-color-primary ant-btn-variant-solid ant-btn-compact-item ant-btn-compact-first-item"
type="button"
>
<span>
Button
</span>
</button>
<span
class="ant-input-group-wrapper ant-input-group-wrapper-outlined ant-input-compact-item ant-input-compact-last-item"
>
<span
class="ant-input-wrapper ant-input-group"
>
<input
class="ant-input ant-input-outlined"
placeholder="input here"
type="text"
value=""
/>
<span
class="ant-input-group-addon"
>
$
</span>
</span>
</span>
</div>
</div>
</div>
`;

View File

@ -2037,6 +2037,41 @@ exports[`renders components/space/demo/compact.tsx correctly 1`] = `
</div>
</div>
</div>
<div
class="ant-space-item"
>
<div
class="ant-space-compact"
>
<button
class="ant-btn ant-btn-primary ant-btn-color-primary ant-btn-variant-solid ant-btn-compact-item ant-btn-compact-first-item"
type="button"
>
<span>
Button
</span>
</button>
<span
class="ant-input-group-wrapper ant-input-group-wrapper-outlined ant-input-compact-item ant-input-compact-last-item"
>
<span
class="ant-input-wrapper ant-input-group"
>
<input
class="ant-input ant-input-outlined"
placeholder="input here"
type="text"
value=""
/>
<span
class="ant-input-group-addon"
>
$
</span>
</span>
</span>
</div>
</div>
</div>
`;

View File

@ -202,6 +202,10 @@ const App: React.FC = () => (
<Input placeholder="input here" />
<ColorPicker />
</Space.Compact>
<Space.Compact>
<Button type="primary">Button</Button>
<Input placeholder="input here" addonAfter="$" />
</Space.Compact>
</Space>
);