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

FlexBasis onComponentDidUpdate?

Open benrudolph opened this issue 5 years ago • 0 comments

Overview of the problem

I'm using re-resizable 6.4.0

My browser is: Chrome

Description

Upon mounting of the Resizable component, it computes the flexBasis state from the computedStyle. However, it never updates its assumption of the flexBasis even if the style changes. The use-case here is building a resizable sidebar that collapses. If the sidebar begins shut, the flexBasis is 0 (assuming that the resizable component is using flex). Then when you try to "open" the sidebar, there's no way to tell Resizable to update its flexBasis state.

Steps to Reproduce

  1. Render a resizable component with flex-basis 0
  2. Re-render by applying new classname that gives it a different flex-basis
  3. Observe that the flex basis state does not change.

https://codesandbox.io/s/ll587k677z

Expected behavior

The component has its flex-basis updated

Actual behavior

The component does not have its flex-basis updated

benrudolph avatar May 19 '20 00:05 benrudolph