diff --git a/packages/components/src/components/header/header.lite.tsx b/packages/components/src/components/header/header.lite.tsx index 938947f0537..4d904364dbc 100644 --- a/packages/components/src/components/header/header.lite.tsx +++ b/packages/components/src/components/header/header.lite.tsx @@ -1,17 +1,17 @@ import { onMount, onUpdate, - Show, Slot, useMetadata, useRef, useStore } from '@builder.io/mitosis'; -import { DBHeaderState, DBHeaderProps } from './model'; +import { DBHeaderProps, DBHeaderState } from './model'; import { addAttributeToChildren, cls, uuid } from '../../utils'; import { DBButton } from '../button'; import { DBDrawer } from '../drawer'; import { DEFAULT_ID } from '../../shared/constants'; +import { isEventTargetNavigationItem } from '../../utils/navigation'; useMetadata({ isAttachedToShadowDom: true @@ -31,6 +31,11 @@ export default function DBHeader(props: DBHeaderProps) { if (props.onToggle) { props.onToggle(!props.drawerOpen); } + }, + handleNavigationItemClick: (event: unknown) => { + if (isEventTargetNavigationItem(event)) { + state.toggle(); + } } }); @@ -72,7 +77,13 @@ export default function DBHeader(props: DBHeaderProps) { open={props.drawerOpen} onClose={() => state.toggle()}>