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: Incorrect suffix position calculation when Typography strong attribute is true #2506

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

pandoralink
Copy link
Contributor

…ribute is true

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

ellipsisContainer 无法准确获取宽度。原因是最终渲染形式为 <strong><span /></strong>,而实际计算基于 <span></span>。若 ellipsisContainer 能够主动传入 fontWeight 或者在计算时包裹一层 <strong> 标签,便可实现准确计算。此外,部分字体的 fontWeight 对宽度影响较为显著。
复现链接 codesandbox

Changelog

🇨🇳 Chinese

  • Fix: fix: Typography strong 属性为 true 时 suffix 位置计算不对

🇺🇸 English

  • Fix: fix: Incorrect suffix position calculation when Typography strong attribute is true

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

Copy link

codesandbox-ci bot commented Sep 22, 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.

Latest deployment of this branch, based on commit accc5c0:

Sandbox Source
pr-story Configuration

@pandoralink
Copy link
Contributor Author

解除了 codesandbox 的查看权限

@YyumeiZhang
Copy link
Collaborator

@pandoralink 感谢PR,由于 strong 类型时候,font-weight 为 600,我这边修改成如果是 strong 类型,将容器的 font-weight 设置为 600

@YyumeiZhang YyumeiZhang merged commit 351eec7 into DouyinFE:main Sep 27, 2024
6 checks passed
Copy link

cypress bot commented Sep 27, 2024

semi-design    Run #2849

Run Properties:  status check passed Passed #2849  •  git commit 351eec71d0: fix: Incorrect suffix position calculation when Typography strong attribute is t...
Project semi-design
Branch Review main
Run status status check passed Passed #2849
Run duration 07m 59s
Commit git commit 351eec71d0: fix: Incorrect suffix position calculation when Typography strong attribute is t...
Committer pandoralink
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 264
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

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.

2 participants