[bug]: useResize
uses content box instead of border box
#2288
Labels
template: bug
This issue might be a bug
useResize
uses content box instead of border box
#2288
Which react-spring target are you using?
@react-spring/web
@react-spring/three
@react-spring/native
@react-spring/konva
@react-spring/zdog
What version of react-spring are you using?
9.7.3
What's Wrong?
useResize
returns the size of the content box, without padding or borders. It should use the border box instead.react-spring/packages/shared/src/dom-events/resize/resizeElement.ts
Lines 42 to 44 in 1e4406e
react-spring/packages/shared/src/dom-events/resize/resizeElement.ts
Lines 7 to 10 in 1e4406e
MDN
To Reproduce
observe an element that has padding.
Expected Behaviour
padding should be included in the returned size.
Link to repo
https://codesandbox.io/p/sandbox/muddy-hill-sjfzwl
The text was updated successfully, but these errors were encountered: