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(AutoComplete): add missing style to ensure alignment #52819

Merged
merged 9 commits into from
Feb 26, 2025

Conversation

aojunhao123
Copy link
Contributor

@aojunhao123 aojunhao123 commented Feb 14, 2025

🤔 This is a ...

  • 🐞 Bug fix

🔗 Related Issues

💡 Background and Solution

Before
QQ_1739547599574

After
QQ_1739547651365

📝 Change Log

Language Changelog
🇺🇸 English Fix: Add a missing style to ensure that the AutoComplete text is centered
🇨🇳 Chinese Fix: 添加缺失样式,确保AutoComplete文字居中对齐

Copy link

stackblitz bot commented Feb 14, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Feb 14, 2025

Preview is ready

Copy link
Contributor

github-actions bot commented Feb 14, 2025

👁 Visual Regression Report for PR #52819 Failed ❌

🎯 Target branch: master (21a44eb)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🆕 6 added

Expected (Branch master) Actual (Current PR) Diff
auto-complete-AutoComplete-and-Select.compact.css-var.png auto-complete-AutoComplete-and-Select.compact.css-var.png 🆕🆕🆕 Added 🆕🆕🆕
auto-complete-AutoComplete-and-Select.compact.png auto-complete-AutoComplete-and-Select.compact.png 🆕🆕🆕 Added 🆕🆕🆕
auto-complete-AutoComplete-and-Select.dark.css-var.png auto-complete-AutoComplete-and-Select.dark.css-var.png 🆕🆕🆕 Added 🆕🆕🆕
auto-complete-AutoComplete-and-Select.dark.png auto-complete-AutoComplete-and-Select.dark.png 🆕🆕🆕 Added 🆕🆕🆕
auto-complete-AutoComplete-and-Select.default.css-var.png auto-complete-AutoComplete-and-Select.default.css-var.png 🆕🆕🆕 Added 🆕🆕🆕
auto-complete-AutoComplete-and-Select.default.png auto-complete-AutoComplete-and-Select.default.png 🆕🆕🆕 Added 🆕🆕🆕

Important

There are 6 diffs found in this PR: 🆕 6 added.
Please check all items:

  • Visual diff is acceptable

Copy link

Walkthrough

This pull request addresses a bug fix by removing an unnecessary CSS style that set a fixed height for the selection search input in the Select component. This change ensures that the input height is not explicitly defined, potentially allowing for more flexible styling and layout.

Changes

File Summary
components/select/style/single.ts Removed the fixed height style for the ${componentCls}-selection-search-input, allowing for more flexible input height management.

Copy link

pkg-pr-new bot commented Feb 14, 2025

Copy link

codecov bot commented Feb 14, 2025

Bundle Report

Changes will increase total bundle size by 156 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.38MB 156 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js 78 bytes 1.84MB 0.0%
antd.min.js 78 bytes 1.54MB 0.01%

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2af20aa) to head (5838ce0).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #52819   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          769       769           
  Lines        13864     13864           
  Branches      3633      3633           
=========================================
  Hits         13864     13864           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -93,10 +93,6 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject {
alignItems: 'center',
padding: `0 ${unit(inputPaddingHorizontalBase)}`,

[`${componentCls}-selection-search-input`]: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不对,AutoComplete 和 Select 是共用样式的。Select 里是对的:
截屏2025-02-17 11 27 41

要看一下 AutoComplete 为什么会不一致

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

不一致的原因在于:非combobox mode下,会多一个item dom,把selector的高度撑起来了。而AutoComplete没有这个dom,又显式设定了height,导致large size下没居中

Copy link

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are accessibility issues in these changes.

<Radio.Button value="middle">middle</Radio.Button>
<Radio.Button value="large">large</Radio.Button>
</Radio.Group>
<Select defaultValue={'centered'} size={size} style={{ width: 200 }} />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

@zombieJ zombieJ self-assigned this Feb 25, 2025
Copy link

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are accessibility issues in these changes.

<Flex vertical gap={16}>
{(['small', 'middle', 'large'] as const).map((size) => (
<Flex key={size}>
<Select
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

<span
class="ant-select-selection-search"
>
<input
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.

Co-authored-by: afc163 <afc163@gmail.com>
Signed-off-by: Jony J <1844749591@qq.com>
@aojunhao123 aojunhao123 changed the title fix(Select): remove unnecessary selection search input height style fix(AutoComplete): add missing style to ensure alignment Feb 26, 2025
@zombieJ zombieJ merged commit 4137ea7 into ant-design:master Feb 26, 2025
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoComplete, size='large' , text is not centered
5 participants