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

Why is width a required prop?

Open AlecRust opened this issue 7 years ago • 5 comments

Thanks for opening an issue!

Please select the type of issue you're reporting. For questions.

  • [ ] Bug
  • [ ] Feature Request
  • [x] Question

Problem Report

I don't have width set on my Resizable because it is a full-width bar with only the y axis resizable.

It works fine, but I get a React warning about this. I can't set it to '100%' either since it requires a number.

Is this prop actually required in my case (doesn't seem to be) and if not can it be marked as such?

screen shot 2017-06-23 at 15 03 21

System Info

Node Version: v6.11.0 Browser: Chrome 59.0 OS: macOS 10.12.5

AlecRust avatar Jun 23 '17 14:06 AlecRust

+1 to the fact '100%' can't be set to width/height. Do you have plans of changing it?

Thanks for the cool library.

dmoskovtsov avatar Jul 04 '17 00:07 dmoskovtsov

Same problem. Need height to be set 100% Upd: ok, have solved problem by setting height and constraints to 'Infinity' value

Sinozet avatar Jul 13 '17 06:07 Sinozet

Setting width values to Infinity worked for me.

Something like:

<ResizableBox
  className="box"
  width={Infinity}
  height={400}
  handleSize={[10, 10]}
  minConstraints={[Infinity, 300]}
  maxConstraints={[Infinity, Infinity]}
  axis="y"
>
  {stuff}
</ResizableBox>

I'm sure it's wrong for reasons, but nothing complains.

JJJ avatar Aug 08 '17 21:08 JJJ

But I set height = {Infinity}, the height is 0; and element' size is number * 0.

Evanna51 avatar Apr 16 '18 08:04 Evanna51

So there is no fix for this?

I wanted to make something like this from polaris but not able to set the on-load witdth to 100% or inherit from parent.

2022-03-31 10_52_50-Text field - Shopify Polaris - Vivaldi

pratyushtewari avatar Mar 31 '22 14:03 pratyushtewari