Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexbox parent and bounds=parent not working as expected #651

Open
wonskarol opened this issue Jul 28, 2020 · 2 comments
Open

Flexbox parent and bounds=parent not working as expected #651

wonskarol opened this issue Jul 28, 2020 · 2 comments

Comments

@wonskarol
Copy link

wonskarol commented Jul 28, 2020

Overview of the problem

I'm using re-resizable version [6.5.4]
My browser is: Chrome Version 83.0.4103.116 (Official Build) (64-bit)

Description

I'm trying to compose two elements inside a flexbox container, one of them is Resizable. The bounds are set to parent (flexbox container). I have noticed that if you put static element as a first child, you are not able to make Resizable bigger (only smaller), see example:
https://codesandbox.io/s/gifted-boyd-xrn1z?file=/src/index.js

However, if you switch the place, like here:

<div style={wrapperStyle}>
      <Resizable
        bounds="parent"
        style={style}
        defaultSize={{
          width: 200,
          height: 200
        }}
      >
        001
      </Resizable>
      <div style={siblingStyle}>002</div>
</div>

everything seems to work.

I would expect, the behaviour is the same regardless of children order.

@rolandjohann
Copy link

having the same issue, except that I lay out the flex as rows. When the resizable is the first element we can completely resize the element to the edges of the parent.

@colinking
Copy link

You may need to set boundsByDirection to true. This fixed this issue for my case, where my component was resized vertically from the top with a fixed bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants