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

feat(useElementSize): support box sizing #2143

Merged
merged 5 commits into from Sep 5, 2022
Merged

Conversation

vaakian
Copy link
Contributor

@vaakian vaakian commented Aug 30, 2022

Description

closes #2158

Currently, it only returns the content-box size, which the padding & border is not included. Even if the box option is configured as border-box.

Additional context

Before

image

After

image


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@vaakian vaakian changed the title fix(useElementSize): support specify boxSizing fix(useElementSize): support boxSizing Aug 30, 2022
@vaakian vaakian closed this Aug 30, 2022
@vaakian vaakian reopened this Aug 30, 2022
@vaakian vaakian changed the title fix(useElementSize): support boxSizing fix(useElementSize): support box sizing Aug 30, 2022
@vaakian vaakian marked this pull request as draft August 30, 2022 14:03
@vaakian vaakian closed this Aug 30, 2022
@vaakian vaakian mentioned this pull request Aug 31, 2022
9 tasks
@vaakian vaakian changed the title fix(useElementSize): support box sizing feat(useElementSize): support box sizing Sep 3, 2022
@vaakian vaakian reopened this Sep 3, 2022
@vaakian vaakian marked this pull request as ready for review September 3, 2022 10:45
@sxzz
Copy link
Member

sxzz commented Sep 4, 2022

I think you need to edit your PR body and add closes #num into it, in order to link the issue to this PR.

@vaakian
Copy link
Contributor Author

vaakian commented Sep 4, 2022

Thanks, I added to the body.

sxzz
sxzz previously approved these changes Sep 4, 2022
Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

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

looks good in general, but I don't familiar with box of useResizeObserver. Can anyone review this?

@antfu antfu enabled auto-merge (squash) September 5, 2022 13:33
@antfu antfu merged commit 3c642b7 into vueuse:main Sep 5, 2022
@vaakian vaakian deleted the useElementSize branch September 9, 2022 09:13
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.

useElementSize returns wrong size when using { box: 'border-box' }
3 participants