fix(ui): fix bug with usePanel

This commit is contained in:
psychedelicious 2024-07-10 18:54:25 +10:00 committed by Kent Keirsey
parent ec1b429d45
commit 88c3a71586

View File

@ -203,14 +203,14 @@ export const usePanel = (arg: UsePanelOptions): UsePanelReturn => {
const onDoubleClickHandle = useCallback(() => { const onDoubleClickHandle = useCallback(() => {
// If the panel is really super close to the min size, collapse it // If the panel is really super close to the min size, collapse it
if (Math.abs((panelHandleRef.current?.getSize() ?? 0) - _minSize) < 0.01) { if (Math.abs((panelHandleRef.current?.getSize() ?? 0) - _defaultSize) < 0.01) {
collapse(); collapse();
return; return;
} }
// Otherwise, resize to the min size // Otherwise, resize to the min size
panelHandleRef.current?.resize(_defaultSize); panelHandleRef.current?.resize(_defaultSize);
}, [_defaultSize, _minSize, collapse]); }, [_defaultSize, collapse]);
return { return {
ref: panelHandleRef, ref: panelHandleRef,