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(useElementSize): use contentBoxSize as an array in useElementSize #2520
Conversation
width.value = boxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0) | ||
height.value = boxSize.reduce((acc, { blockSize }) => acc + blockSize, 0) | ||
const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize] | ||
if (formatBoxSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boxSize
may be undefined
, so formatBoxSize may goes [ undefined ]
and go into the if block.
Put the check inside the if block would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a good suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed it, please review again @vaakian
e01600b
to
adb10a3
Compare
Please merge this pr @antfu |
adb10a3
to
85be398
Compare
efb09be
to
ab2d7fa
Compare
ab2d7fa
to
0b12871
Compare
Hi, when can we expect a bugfix release? |
Description
Fixes #2519
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).