react-rnd icon indicating copy to clipboard operation
react-rnd copied to clipboard

Dragging to edge increases bounding container size when overflow: auto

Open BerndSchrooten opened this issue 5 years ago • 4 comments

Overview of the problem

When using RND in a container with the css attribute overflow: auto, dragging to the right and bottom edge will cause some browsers to increase the size of the container and scroll bars will show. The RND box is kept within the original bounds though.

I'm using react-rnd version [10.1.10]

My browser is:
Chrome, Edge Chromium, Firefox

Does not happen on safari

Reproduced project

https://codesandbox.io/s/jolly-montalcini-p485m

Expected behavior

The container does not increase in size and no scroll bars are shown

Actual behavior

The container size is increased and scroll bars are shown

BerndSchrooten avatar Jun 16 '20 15:06 BerndSchrooten

I changed it to overflow: 'hidden and think it solves your issue https://codesandbox.io/s/busy-cdn-bv0hw?file=/src/styles.css

amandakoster avatar Jul 24 '20 00:07 amandakoster

Changing overflow to hidden is problematic for cases where the container is outside of the viewport. For example when resizing the window or persisting the location of the container. With overflow hidden you would not be able to find the container then

BerndSchrooten avatar Jul 28 '20 13:07 BerndSchrooten