chore: Clean techdocs-module-addons-contrib ExpandableNavigation

Co-authored-by: Mark Avery <mark@webark.cc>
Signed-off-by: Gabriel Dugny <gabriel@dugny.me>
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
Gabriel Dugny
2025-09-16 10:25:10 +02:00
committed by Gabriel Dugny
parent 98f4e6339d
commit f912df08fc
@@ -92,15 +92,7 @@ export const ExpandableNavigationAddon = () => {
useEffect(() => {
if (!checkboxToggles?.length) return;
function shouldToggle(item: HTMLInputElement) {
const isExpanded = item.checked;
const shouldExpand = expanded?.expandAllNestedNavs;
if (shouldExpand && !isExpanded) {
return true;
}
if (!shouldExpand && isExpanded) {
return true;
}
return false;
return expanded?.expandAllNestedNavs !== item.checked;
}
for (const item of checkboxToggles) {
if (shouldToggle(item)) {