equinor / webviz

Mozilla Public License 2.0
6 stars 6 forks source link

`ResizablePanels`-component: `minSizes`-prop does not limit values sent to `onSizesChange`-prop #572

Closed jorgenherje closed 5 months ago

jorgenherje commented 7 months ago

Two issues seen when resizing panels:

1) Seems like an issue occurs if width resizing is dragged below min-width. The onSizesChange prop provides values below the minSizes values, thereby sizing behaves odd? The video below shows how the cursor is dragged passed the minWidth on settings drawer on left side. Resize of the filter panel on the right side then result in a "jump" when releasing the mouse button. This is due to the fact that the stored width of the settings drawer is updated after the cursor is dragged passed the configured minWidth. Afterwards the same procedure is done for the filter panel on the right - dragging the cursor passed the minWidth. We then see a "jump" when releasing the mouse button after resizing the settings drawer on the left.

https://github.com/equinor/webviz/assets/82032112/690c57f6-2f62-492a-8be8-49d0bb5c1d50

2) When resizing a panel s.t. it is collapsed/hidden, the width is not set to 0. Thereby logic based on its visibility does not work correctly. An example is shown in the video below, where it is of interest to toggle open/closed state with a button, but the width is not set to 0. However the panel is not visible.

https://github.com/equinor/webviz/assets/82032112/76ef797c-929b-4a70-b236-769494b99b9a