fix: align borderless Input and Select component heights#57014
fix: align borderless Input and Select component heights#57014afc163 merged 1 commit intoant-design:masterfrom
Conversation
When Input uses variant='borderless', it sets border: 'none' which removes the border entirely, causing the total height to be 2px less than controlHeight (since paddingBlock already subtracts lineWidth). Meanwhile, Select borderless keeps a transparent border that still occupies space, maintaining the full controlHeight. This fix compensates for the removed border by adding lineWidth back to the vertical padding of borderless Input, ensuring both Input and Select have consistent heights (controlHeight) in borderless mode. Fixes ant-design#56609
|
|
Summary of ChangesHello @njlazzar-su, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an inconsistency in component heights when using the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
👁 Visual Regression Report for PR #57014 Failed ❌
Warning There are more diffs not shown in the table. Please check the Full Report for details. Important There are 12 diffs found in this PR: 🔄
|
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughSummary by CodeRabbit样式优化
概述修复 borderless 状态下 Input 组件不同尺寸的高度不一致问题,通过添加 paddingBlock 补偿移除 border 后的高度差异,确保各尺寸变体高度一致。 变更详情
评估代码审查工作量🎯 1 (Trivial) | ⏱️ ~5 分钟 代码精选诗
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request addresses an inconsistency in height between borderless Input and Select components. The fix correctly compensates for the removed border on the borderless Input by adding the lineWidth back to the vertical padding. This change is consistently applied across all sizes (default, small, and large) and for both standard inputs and those with prefixes or suffixes. The implementation is clear, targeted, and effectively resolves the visual bug.
More templates
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #57014 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 808 808
Lines 15045 15045
Branches 3962 3962
=========================================
Hits 15045 15045 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 530 bytes (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
Files in
Files in
|


























Summary
Fix inconsistent heights between borderless
InputandSelectcomponents.Problem
When using
variant="borderless", theInputcomponent is 2px shorter than theSelectcomponent:border: 'none', which removes the border entirely. SincepaddingBlockis already calculated as(controlHeight - fontHeight) / 2 - lineWidth, the total height becomescontrolHeight - 2 * lineWidth(e.g., 30px instead of 32px).borderColor: transparent), so it still occupies space. Total height remainscontrolHeight(32px).Fix
Compensate for the removed border by adding
lineWidthback to the vertical padding (paddingBlock) of borderless Input. This ensures both components maintain a consistent height equal tocontrolHeightin borderless mode.The fix covers all three sizes (default, small, large) and both bare input and affix-wrapper (input with prefix/suffix) variants.
Related Issues
Fixes #56609
Type of Change
Testing
genBorderlessStyle) also benefits from this fix