ZeeCoder / use-resize-observer

A React hook that allows you to use a ResizeObserver to measure an element's size.
MIT License
651 stars 42 forks source link

Padding not taken into account ? #57

Closed abernierloreal closed 3 years ago

abernierloreal commented 3 years ago

A little question,

Is that normal that padding isn't taken into account in the returned height value ?

NB: I have the rule * {box-sizing:border-box;} if ever it matters

Thank you

ZeeCoder commented 3 years ago

The library uses ResizeObserver.observe() without any extra options, which means it observes the content-box according to MDN

I think this issue is sort of related to this PR.

Once an option is added for that, it will handle your use-case, but it's not possible at the moment.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 8.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: