Skip to content

Commit

Permalink
fix keyboard shortcuts in new commandbar
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Aug 13, 2024
1 parent cc7ff45 commit 157ed55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Explorer/Menus/CommandBarV2/CommandBarV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { makeStyles, Menu, MenuItem, MenuList, MenuPopover, MenuTrigger, Toolbar
import { CommandButtonComponentProps } from "Explorer/Controls/CommandButton/CommandButtonComponent";
import Explorer from "Explorer/Explorer";
import { createPlatformButtons, createStaticCommandBarButtons } from "Explorer/Menus/CommandBar/CommandBarComponentButtonFactory";
import { createKeyboardHandlers } from "Explorer/Menus/CommandBar/CommandBarUtil";
import { useCommandBar } from "Explorer/Menus/CommandBar/useCommandBar";
import { CosmosFluentProvider, cosmosShorthands, tokens } from "Explorer/Theme/ThemeUtil";
import { useSelectedNode } from "Explorer/useSelectedNode";
Expand Down Expand Up @@ -33,9 +34,14 @@ export const CommandBarV2: React.FC<CommandBarV2Props> = ({ explorer }: CommandB
const platformButtons = createPlatformButtons();

if (isHidden) {
setKeyboardHandlers({});
return null;
}

const allButtons = staticButtons.concat(contextButtons).concat(platformButtons);
const keyboardHandlers = createKeyboardHandlers(allButtons, explorer);
setKeyboardHandlers(keyboardHandlers);

return <CosmosFluentProvider>
<Toolbar className={styles.toolbar}>
<ToolbarGroup role="presentation" className={styles.toolbarGroup}>
Expand Down

0 comments on commit 157ed55

Please sign in to comment.