-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Rounded widths and heights #61
Comments
There's something in the works for this, I'm just way to strained to take a proper look. :( See also: #46 (comment) We're not using getBoundingClientRect as one of the big selling points to using uRO is it not triggering a layout in the browser like getBoundingClientRect does. |
@ZeeCoder Don't worry at all about not being able to get to this. You are in no way obligated to do anything here, and I appreciate you taking the time to respond in the first place. Just for posterity's sake, I'm going to include my current work around, in case it helps eventually solve this issue, or provides help to anyone else who is facing it. I am currently getting a width from the useResizeObserver, and use that width as a dependent in my useEffect hook, where I am reacting to the change. In that useEffect hook, after checking to make sure the ref provided too useResizeObserver has an element at current, I get the non rounded width with Two last caveat to leave behind for other people to consider, and possible explain if they understand better. First, I do not completely understand the issue of "uRO is it not triggering a layout in the browser like getBoundingClientRect does", and thus any issues that come out of that fact are not taking into consideration in my solution above. Second, an alternative too using getBoundingClientRect seems to be getComputedStyle, as in |
@DrewVartanian really appreciate you taking the time to write all that feedback. 👌 |
# [7.1.0](v7.0.1...v7.1.0) (2021-08-28) ### Bug Fixes * The `onResize` callback is no longer incorrectly called with the same values. ([29938a1](29938a1)) ### Features * Added the `box` option ([f873597](f873597)), closes [#31](#31) [#57](#57) * Added the `round` option. ([1224bc8](1224bc8)), closes [#55](#55) [#46](#46) [#61](#61)
# [7.1.0](v7.0.1...v7.1.0) (2021-08-28) ### Bug Fixes * The `onResize` callback is no longer incorrectly called with the same values. ([29938a1](29938a1)) ### Features * Added the `box` option ([f873597](f873597)), closes [#31](#31) [#57](#57) * Added the `round` option. ([1224bc8](1224bc8)), closes [#55](#55) [#46](#46) [#61](#61)
# [8.0.0](v7.0.1...v8.0.0) (2021-08-28) ### Bug Fixes * Removed `resize-observer-polyfill` in favour of `@juggle/resize-observer`. ([8afc8f6](8afc8f6)) * The `onResize` callback is no longer incorrectly called with the same values. ([bd0f3c8](bd0f3c8)) ### Features * Added the `box` option ([0ca6c23](0ca6c23)), closes [#31](#31) [#57](#57) * Added the `round` option. ([aa38199](aa38199)), closes [#55](#55) [#46](#46) [#61](#61) * Triggering the v8 release ([4373a1f](4373a1f)) ### BREAKING CHANGES * Triggering the v8 release, which was published as 7.1.0 by accident.
🎉 This issue has been resolved in version 8.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Would it be possible to use getBoundingClientRect() to measure widths and heights, so that the values are not rounded? I have run into situations where not having the floating-point values has caused issues when using those measurements. If there is a situation where users may want the rounded value that I am not thinking of, then having an option to get the floating-point values would also work.
The text was updated successfully, but these errors were encountered: