Fixed sidebar not closing when searching

This commit is contained in:
Lucas Oliveira 2023-10-25 20:01:49 -03:00
commit b691237d77
2 changed files with 3 additions and 5 deletions

View file

@ -8,7 +8,7 @@ export default function DisclosureComponent({
openDisc,
}: DisclosureComponentType): JSX.Element {
return (
<Disclosure as="div" key={title}>
<Disclosure as="div" defaultOpen={openDisc} key={title}>
{({ open }) => (
<>
<div>
@ -34,9 +34,7 @@ export default function DisclosureComponent({
</div>
</Disclosure.Button>
</div>
<Disclosure.Panel as="div" static={openDisc}>
{children}
</Disclosure.Panel>
<Disclosure.Panel as="div">{children}</Disclosure.Panel>
</>
)}
</Disclosure>

View file

@ -228,7 +228,7 @@ export default function ExtraSidebar(): JSX.Element {
Object.keys(dataFilter[SBSectionName]).length > 0 ? (
<DisclosureComponent
openDisc={search.length == 0 ? false : true}
key={index}
key={index + search}
button={{
title: nodeNames[SBSectionName] ?? nodeNames.unknown,
Icon: