Raphaël Bosi
2025-06-13 14:50:30 +02:00
committed by GitHub
parent 194549b77e
commit 96c2f5477c
2 changed files with 16 additions and 9 deletions

View File

@ -37,6 +37,7 @@ export const MainNavigationDrawerFixedItems = () => {
Icon={IconSearch}
onClick={openRecordsSearchPage}
keyboard={['/']}
mouseUpNavigation={true}
/>
<NavigationDrawerItem
label={t`Settings`}

View File

@ -39,6 +39,7 @@ export type NavigationDrawerItemProps = {
isDragging?: boolean;
isRightOptionsDropdownOpen?: boolean;
triggerEvent?: TriggerEventType;
mouseUpNavigation?: boolean;
};
type StyledItemProps = Pick<
@ -253,6 +254,7 @@ export const NavigationDrawerItem = ({
isDragging,
isRightOptionsDropdownOpen,
triggerEvent,
mouseUpNavigation = false,
}: NavigationDrawerItemProps) => {
const theme = useTheme();
const isMobile = useIsMobile();
@ -268,8 +270,10 @@ export const NavigationDrawerItem = ({
}
};
const { onClick: handleClick, onMouseDown: handleMouseDown } =
useMouseDownNavigation({
const {
onClick: handleMouseDownNavigationClickClick,
onMouseDown: handleMouseDown,
} = useMouseDownNavigation({
to,
onClick,
onBeforeNavigation: handleMobileNavigation,
@ -280,8 +284,10 @@ export const NavigationDrawerItem = ({
<StyledNavigationDrawerItemContainer>
<StyledItem
className={`navigation-drawer-item ${className || ''}`}
onClick={handleClick}
onMouseDown={handleMouseDown}
onClick={
mouseUpNavigation ? onClick : handleMouseDownNavigationClickClick
}
onMouseDown={mouseUpNavigation ? undefined : handleMouseDown}
active={active}
aria-selected={active}
danger={danger}