ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
90.41k stars 46.39k forks source link

Watermark container size changes, resulting in incomplete display or disappearance of watermarks #48660

Open 765477020 opened 2 weeks ago

765477020 commented 2 weeks ago

中文版模板 / Chinese template

🤔 This is a ...

🔗 Related issue link

在浏览器控制台修改Watermark组件的父div尺寸时,水印显示不全或消失

💡 Background and solution

通过MutateObserver API来监听container dom的属性值是否发生变化 当dom属性值发生变化时,更新container的key值,利用react的diff算法key值发生变化重新渲染

📝 Changelog

Language Changelog
🇺🇸 English Watermark container size changes, resulting in incomplete display or disappearance of watermarks
🇨🇳 Chinese Watermark容器大小变化,导致水印显示不全或消失

☑️ Self-Check before Merge

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

stackblitz[bot] commented 2 weeks ago

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

github-actions[bot] commented 2 weeks ago

Preview is ready

github-actions[bot] commented 2 weeks ago

👁 Visual Regression Report for PR #48660 Passed ✅

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

🎊 Congrats! No visual-regression diff found.

zombieJ commented 2 weeks ago

What's related issue or reproduce?

codesandbox-ci[bot] commented 2 weeks ago

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.

765477020 commented 2 weeks ago

What's related issue or reproduce?

Have been updated

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 83.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.99%. Comparing base (0f06598) to head (afc9818).

Files Patch % Lines
components/watermark/index.tsx 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #48660 +/- ## =========================================== - Coverage 100.00% 99.99% -0.01% =========================================== Files 746 746 Lines 12994 12998 +4 Branches 3411 3412 +1 =========================================== + Hits 12994 12997 +3 - Misses 0 1 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

zombieJ commented 2 weeks ago

Have been updated

@765477020 录个视频看看?

zombieJ commented 1 week ago

@765477020 录个视频看看?

@765477020,想看看说的问题具体是什么样子的。

765477020 commented 1 week ago

@765477020 录个视频看看?

@765477020,想看看说的问题具体是什么样子的。

您好,研究了半天搞了一个录屏,但是分辨率不是很高,抱歉

https://github.com/ant-design/ant-design/assets/62086147/a14a6656-70c9-4544-86af-99e0a57e7d9e