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

Bug: unable to resize height when default height is set to a percentage

Open elie222 opened this issue 7 years ago • 4 comments

Overview of the problem

I'm using react-rnd version [9.0.4]

My browser is: Chrome (Mac)

Reproduced project

https://codesandbox.io/s/w7p3p81oy5

Description

Steps to Reproduce

  1. Drag the bottom side or corner of the box up or down.

Expected behavior

The height of the box is adjusted.

Actual behavior

The height of the box stays the same.

elie222 avatar Dec 05 '18 19:12 elie222

Hey, i've just run into your issue to see if there are some deal-breakers when using this library. Anyway, this should work and be solved if you set height to parent container. Right now the container has 0 height. If you set height to e.g. 100vh of the container <div id="root">, the percentage should work ;)

kure- avatar Dec 06 '18 09:12 kure-

@kure- Thanks :) @elie222 Please check https://codesandbox.io/s/n42x6krq10

bokuweb avatar Dec 06 '18 13:12 bokuweb

@bokuweb please have a look at this https://codesandbox.io/s/icy-dew-pohbz

Bouncue avatar May 26 '19 12:05 Bouncue

I had too many nested divs to set the heights to some value. Couldn't make the above "hack" work. Instead, not passing the props for max/min/default height and directly applying css overrides (!important) worked.

However, it might be worth documenting/fixing this issue.

areebbeigh avatar May 29 '21 11:05 areebbeigh