Option to set maxSize/minSize to % rather than px
CrumpetsNTea opened this issue · 1 comments
Hi! I was wondering if it would be possible to set maxSize/minSize to a percentage value? I thought this would make sense, since the sizes option is measured in percentage. It would be far more convenient to have maxSize/minSize available to be set as a responsive measurement rather than px.
The primary issue with this is that when I resize the window, it causes a bug where I can no longer resize the columns, it just jumps to one size when I click the gutter. This is resolved by refreshing the page, however this is highly inconvenient. This is likely because of the pixel value changing on window resize. I do not believe this would happen if the value was percentage.
I was able to resolve this by having a resize event listener in a useEffect, which then updated a state variable with the window.innerWidth. I then used this state variable to set the minSize.
This makes minSize dynamically set to the appropriate size based on the window width, versus being hardcoded to a px value.
Ultimately, I believe being able to set the minSize/maxSize values to % rather than px would also resolve this.