Skip to content

Gap in Cropper component on first launch #400

@khnhle

Description

@khnhle

Describe the bug
I followed the example over at https://codesandbox.io/s/y09komm059. Everything seems to work great, except on initial load, the crop window leaves visible gaps on each side (despite scrolling and zooming all the way out). However, the strange thing is that the output image doesn't show gaps like the Cropper component.
Cropper returns to normal only after I'm sliding the rotate slider, and, voila, it snaps to 200px again :)

Is there some styling I'm missing or some ref I need to forward?

My project is desperately in need of a refactor, so here is a screenshot:
https://i.imgur.com/4xnvRR3_d.webp?maxwidth=760&fidelity=grand

Like the example, I set Cropper's container height to 200px, but on initial load (without rotating it with the rotate slider), Cropper's height is set to 190px for some strange reason:
https://i.imgur.com/LptVWZ2_d.webp?maxwidth=760&fidelity=grand

I'll try my best to make a sandbox to reproduce the bug, but it gonna take a while :)

I also use Nextjs & chakra-ui.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions