Skip to content

Zoom style tag can alter the result #101

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

Open
TMarciDev opened this issue Sep 17, 2024 · 0 comments
Open

Zoom style tag can alter the result #101

TMarciDev opened this issue Sep 17, 2024 · 0 comments

Comments

@TMarciDev
Copy link

If I use it on a page where the responsive design alters the zoom value on the body to like 75% to make everything fit, the useMeasure will not correct for that and returns smaller values than the actual size.

To correct width and height you can do this:

const [ref, measurement] = useMeasure(input);
const result = { ...measurement, height: getCorrectedSize(measurement.height), width: getCorrectedSize(measurement.width) };

and this will gives back the correct sizes.

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

No branches or pull requests

1 participant