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: use getBoundingClientRect to get the exact size #2482

Closed
wants to merge 5 commits into from

Conversation

li-yechao
Copy link

[中文版模板 / Chinese template]

🤔 This is a ...

  • Bug fix

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

@CLAassistant
Copy link

CLAassistant commented Feb 19, 2024

CLA assistant check
All committers have signed the CLA.

@@ -24,8 +23,8 @@ function useSize(target: BasicTarget): Size | undefined {

const resizeObserver = new ResizeObserver((entries) => {
entries.forEach((entry) => {
const { clientWidth, clientHeight } = entry.target;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能这么改,clientWidth 和 getBoundingClientRect 的 width 是有差别的,clientWidth 是不包含border 的,width 是包含的,这样改会有 break change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌,那可以考虑加一个 useBoundingClientRect hook?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌,那可以考虑加一个 useBoundingClientRect hook?

v4 大版本考虑一下怎么把这些相关的统一一下,这个 pr 我先 close 了

@crazylxr crazylxr closed this Feb 24, 2024
@liuyib liuyib added the v4 label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants