diff --git a/packages/shared-ux/chrome/navigation/src/ui/hooks/use_accordion_state.ts b/packages/shared-ux/chrome/navigation/src/ui/hooks/use_accordion_state.ts index 8ebf91a949db2..070243470b5e5 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/hooks/use_accordion_state.ts +++ b/packages/shared-ux/chrome/navigation/src/ui/hooks/use_accordion_state.ts @@ -92,12 +92,12 @@ export const useAccordionState = ({ navNode }: { navNode: ChromeProjectNavigatio const getAccordionProps = useCallback( ( path: string, - _accordionProps?: Partial + accordionProps?: Partial ): Partial | undefined => { const isCollapsed = accordionStateById[path]?.isCollapsed; const isCollapsible = accordionStateById[path]?.isCollapsible; - if (isCollapsed === undefined) return _accordionProps; // No state set yet + if (isCollapsed === undefined) return accordionProps; // No state set yet let forceState: EuiAccordionProps['forceState'] = isCollapsed ? 'closed' : 'open'; if (!isCollapsible) forceState = 'open'; // Allways open if the accordion is not collapsible @@ -109,9 +109,8 @@ export const useAccordionState = ({ navNode }: { navNode: ChromeProjectNavigatio const updated: Partial = { buttonProps: { 'data-test-subj': 'accordionToggleBtn' }, - ..._accordionProps, + ...accordionProps, arrowProps, - isCollapsible, forceState, onToggle: isCollapsible ? () => {