ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

fix(module:avatar): calculate size at the right time

Open HyperLife1119 opened this issue 5 months ago • 2 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Documentation content changes
  • [ ] Application (the showcase website) / infrastructure changes
  • [ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

当 文字类型的头像 在像 dropdown 这种 overlay 组件中渲染时,无法正确计算文本尺寸: image

What is the new behavior?

通过使用 afterRender 来确保可以正确 读/写 DOM 来解决该问题: image

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

HyperLife1119 avatar Sep 16 '24 14:09 HyperLife1119