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(Select): fix prefix text wrap and overlap with placeholder #51625

Closed
wants to merge 1 commit into from

Conversation

guoyunhe
Copy link
Contributor

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ❓ Other (about what?)

🔗 Related Issues

Fix #51623

💡 Background and Solution

当 prefix 为中文或者英文带空格,默认的 Flex 布局压缩会导致 prefix 文字换行。之前由于 prefix demo 用的是单个英文单词,所以没有发现。

另外多选模式下 prefix 和 placeholder 和重叠是因为 -selection-wrap 没有 position: relative 所致。

📝 Change Log

Language Changelog
🇺🇸 English fix(Select): fix prefix text wrap and overlap with placeholder
🇨🇳 Chinese fix(Select): 修复 prefix 文字换行和与 placeholder 重叠的问题

Copy link

stackblitz bot commented Nov 14, 2024

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

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Preview is ready

Copy link
Contributor

github-actions bot commented Nov 14, 2024

👁 Visual Regression Report for PR #51625 Failed ❌

🎯 Target branch: master (f3618aa)
📖 View Full Report ↗︎

Expected (Branch master) Actual (Current PR) Diff
select-component-token.compact.png select-component-token.compact.png select-component-token.compact.png select-component-token.compact.png
select-component-token.compact.png select-component-token.compact.png select-component-token.compact.css-var.png select-component-token.compact.css-var.png
select-component-token.dark.png select-component-token.dark.png select-component-token.dark.png select-component-token.dark.png
select-component-token.dark.png select-component-token.dark.png select-component-token.dark.css-var.png select-component-token.dark.css-var.png
select-component-token.default.png select-component-token.default.png select-component-token.default.png select-component-token.default.png
select-component-token.default.png select-component-token.default.png select-component-token.default.css-var.png select-component-token.default.css-var.png
select-option-label-center.dark.png select-option-label-center.dark.png select-option-label-center.dark.png select-option-label-center.dark.png
select-option-label-center.dark.png select-option-label-center.dark.png select-option-label-center.dark.css-var.png select-option-label-center.dark.css-var.png

Warning

There are more diffs not shown in the table. Please check the Full Report for details.


Important

There are 10 diffs found in this PR: 🔄 10 changed.
Please check all items:

  • Checked all diffs in the full report
  • Visual diff is acceptable

Copy link

Walkthrough

This pull request addresses a bug in the Select component where the prefix text would wrap and overlap with the placeholder. The issue was more evident when the prefix was in Chinese or English with spaces. The solution involves adjusting the CSS styles to prevent text wrapping and overlapping.

Changes

Files Summary
BUG_VERSIONS.json Added a new bug version entry for issue #51623.
components/select/style/multiple.ts Added position: relative to .selection-wrap and flex: 0 0 auto to .prefix to fix text wrapping and overlapping issues.
components/select/style/single.ts Added flex: 0 0 auto to .prefix to fix text wrapping issues.

Copy link

pkg-pr-new bot commented Nov 14, 2024

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (f3618aa) to head (4dab3d9).
Report is 20 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #51625   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          761       761           
  Lines        13547     13543    -4     
  Branches      3533      3533           
=========================================
- Hits         13547     13543    -4     

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


🚨 Try these New Features:

@afc163
Copy link
Member

afc163 commented Nov 14, 2024

visual diff 不太对。

@guoyunhe guoyunhe force-pushed the fix-select-prefix branch 9 times, most recently from e7e5775 to fb19014 Compare November 15, 2024 06:53
@guoyunhe
Copy link
Contributor Author

@afc163 已经本地验证过了视觉上是一致的(打开关闭 CSS Var 都试过了),但是 Diff 就是不过,不知道为神马 😢

@zombieJ zombieJ self-assigned this Nov 15, 2024
@guoyunhe guoyunhe closed this Nov 15, 2024
@guoyunhe guoyunhe reopened this Nov 15, 2024
@zombieJ zombieJ mentioned this pull request Nov 19, 2024
16 tasks
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.

select prefix 样式问题
3 participants