Bug - sidebar opening (#1084)
This commit is contained in:
commit
58f83aaa98
2 changed files with 9 additions and 7 deletions
|
|
@ -8,7 +8,7 @@ export default function DisclosureComponent({
|
||||||
openDisc,
|
openDisc,
|
||||||
}: DisclosureComponentType): JSX.Element {
|
}: DisclosureComponentType): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Disclosure as="div" key={title}>
|
<Disclosure as="div" defaultOpen={openDisc} key={title}>
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -35,9 +35,7 @@ export default function DisclosureComponent({
|
||||||
</div>
|
</div>
|
||||||
</Disclosure.Button>
|
</Disclosure.Button>
|
||||||
</div>
|
</div>
|
||||||
<Disclosure.Panel as="div" static={openDisc}>
|
<Disclosure.Panel as="div">{children}</Disclosure.Panel>
|
||||||
{children}
|
|
||||||
</Disclosure.Panel>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Disclosure>
|
</Disclosure>
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ export default function ExtraSidebar(): JSX.Element {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setSearch("search");
|
setSearch("");
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -227,8 +227,12 @@ export default function ExtraSidebar(): JSX.Element {
|
||||||
.map((SBSectionName: keyof APIObjectType, index) =>
|
.map((SBSectionName: keyof APIObjectType, index) =>
|
||||||
Object.keys(dataFilter[SBSectionName]).length > 0 ? (
|
Object.keys(dataFilter[SBSectionName]).length > 0 ? (
|
||||||
<DisclosureComponent
|
<DisclosureComponent
|
||||||
openDisc={search.length == 0 ? false : true}
|
openDisc={
|
||||||
key={index}
|
getFilterEdge.length !== 0 || search.length !== 0
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
|
key={index + search + JSON.stringify(getFilterEdge)}
|
||||||
button={{
|
button={{
|
||||||
title: nodeNames[SBSectionName] ?? nodeNames.unknown,
|
title: nodeNames[SBSectionName] ?? nodeNames.unknown,
|
||||||
Icon:
|
Icon:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue