fix(ui): do not resize panel when window resizes if panel is collapsed

This commit is contained in:
psychedelicious 2024-01-04 18:39:45 +11:00 committed by Kent Keirsey
parent 7a57bc99cf
commit 01bab58b20

View File

@ -125,8 +125,9 @@ export const usePanel = (arg: UsePanelOptions): UsePanelReturn => {
_setMinSize(minSizePct);
const currentSize = panelHandleRef.current.getSize();
// Resize if the current size is smaller than the new min size - happens when the window is resized smaller
if (panelHandleRef.current.getSize() < minSizePct) {
if (currentSize && currentSize < minSizePct) {
panelHandleRef.current.resize(minSizePct);
}
});