mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix edge case in panels
Not sure why I didn't figure out how to do this before - we only should reset a panel if it's too small.
This commit is contained in:
parent
8f0edcd4f4
commit
6bf29b20af
@ -113,18 +113,9 @@ export const usePanel = (arg: UsePanelOptions): UsePanelReturn => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const minSizePct = getSizeAsPercentage(arg.minSize, arg.panelGroupRef, arg.panelGroupDirection);
|
const minSizePct = getSizeAsPercentage(arg.minSize, arg.panelGroupRef, arg.panelGroupDirection);
|
||||||
|
|
||||||
_setMinSize(minSizePct);
|
_setMinSize(minSizePct);
|
||||||
|
|
||||||
/**
|
if (!panelHandleRef.current.isCollapsed() && panelHandleRef.current.getSize() < minSizePct && minSizePct > 0) {
|
||||||
* TODO(psyche): Ideally, we only resize the panel if there is not enough room for it in the
|
|
||||||
* panel group. This is a bit tricky, though. We'd need to track the last known panel size
|
|
||||||
* and compare it to the new size before resizing. This introduces some complexity that I'd
|
|
||||||
* rather not need to maintain.
|
|
||||||
*
|
|
||||||
* For now, we'll just resize the panel to the min size every time the panel group is resized.
|
|
||||||
*/
|
|
||||||
if (!panelHandleRef.current.isCollapsed()) {
|
|
||||||
panelHandleRef.current.resize(minSizePct);
|
panelHandleRef.current.resize(minSizePct);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user