mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): make invoketabs not lazy
This commit is contained in:
parent
2aefa06ef1
commit
35f6b5d562
@ -166,20 +166,8 @@ export default function InvokeTabs() {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* isLazy means the tabs are mounted and unmounted when changing them. There is a tradeoff here,
|
|
||||||
* as mounting is expensive, but so is retaining all tabs in the DOM at all times.
|
|
||||||
*
|
|
||||||
* Removing isLazy messes with the outside click watcher, which is used by ResizableDrawer.
|
|
||||||
* Because you have multiple handlers listening for an outside click, any click anywhere triggers
|
|
||||||
* the watcher for the hidden drawers, closing the open drawer.
|
|
||||||
*
|
|
||||||
* TODO: Add logic to the `useOutsideClick` in ResizableDrawer to enable it only for the active
|
|
||||||
* tab's drawer.
|
|
||||||
*/
|
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<Tabs
|
||||||
isLazy
|
|
||||||
defaultIndex={activeTab}
|
defaultIndex={activeTab}
|
||||||
index={activeTab}
|
index={activeTab}
|
||||||
onChange={(index: number) => {
|
onChange={(index: number) => {
|
||||||
|
@ -93,12 +93,9 @@ const ResizableDrawer = ({
|
|||||||
useOutsideClick({
|
useOutsideClick({
|
||||||
ref: outsideClickRef,
|
ref: outsideClickRef,
|
||||||
handler: () => {
|
handler: () => {
|
||||||
if (isPinned) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
},
|
},
|
||||||
|
enabled: isOpen && !isPinned,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleEnables = useMemo(
|
const handleEnables = useMemo(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user