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

refactor: Use native css for measure css line ellipsis #47597

Merged
merged 14 commits into from Feb 27, 2024
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 26, 2024

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

截屏2024-02-26 19 00 26

使用 css 做高度测量,然后再对比是否需要溢出。以解决精度问题、元素行高不同的问题。同时提供一个接口用于告知当前的 Typography 是否是在可展开、收起状态。

📝 Changelog

Language Changelog
🇺🇸 English Refactor Typography ellipsis code to support dynamic line height.
🇨🇳 Chinese 重构 Typography 省略测量逻辑以支持动态行高的场景。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

stackblitz bot commented Feb 26, 2024

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

Copy link
Contributor

github-actions bot commented Feb 26, 2024

👁 Visual Regression Report for PR #47597 Failed ❌

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

Image name Expected Actual Diff
typography-ellipsis-debug.compact.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-debug.compact.css-var.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-debug.dark.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-debug.dark.css-var.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-debug.default.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-debug.default.css-var.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-middle.compact.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-middle.compact.css-var.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-middle.dark.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff
typography-ellipsis-middle.dark.css-var.png master: c06dc8e96017f3590b73993fb1c625b36f40e0c1 current: pr-47597 diff

Check Full Report for details

Copy link
Contributor

github-actions bot commented Feb 26, 2024

Preview is ready

Copy link
Contributor

github-actions bot commented Feb 26, 2024

size-limit report 📦

Path Size
./dist/antd.min.js 333.56 KB (+140 B 🔺)
./dist/antd-with-locales.min.js 379.7 KB (+531 B 🔺)

crazyair
crazyair previously approved these changes Feb 26, 2024
Copy link

codesandbox-ci bot commented Feb 27, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (9c72ee3) to head (e533540).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #47597   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          734       736    +2     
  Lines        12593     12594    +1     
  Branches      3298      3302    +4     
=========================================
+ Hits         12593     12594    +1     

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

@zombieJ zombieJ merged commit 72ee451 into master Feb 27, 2024
105 of 106 checks passed
@zombieJ zombieJ deleted the ellipsis-check branch February 27, 2024 08:56
Copy link
Contributor

🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

@crazyair crazyair mentioned this pull request Mar 1, 2024
20 tasks
tanzhenyun pushed a commit to DraculaPrince/mark15 that referenced this pull request Mar 29, 2024
)

* chore: init

* chore: ellpsis check with native css

* docs: all the lines

* chore: move copied btn out

* chore: add dpes

* fix: logic order

* fix: ellipsis event

* test: update testcase

* chore: use native way

* chore: destructure

* chore: fix lint

* chore: fix lint

* chore: fix lint
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.

None yet

4 participants