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:
committed by
Gabriel Dugny
parent
98f4e6339d
commit
f912df08fc
+1
-9
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user