Skip to content

Zoom style tag can alter the result #101

@TMarciDev

Description

@TMarciDev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions