- {/* the zIndex ensures this menu has higher stacking order,
+
+
+ {/* the zIndex ensures this menu has higher stacking order,
see https://github.com/excalidraw/excalidraw/pull/1445 */}
- {device.isMobile ? (
- {children}
- ) : (
-
- {children}
-
- )}
-
+ {device.isMobile ? (
+ {children}
+ ) : (
+
+ {children}
+
+ )}
+
+
);
};
-export default MenuContent;
MenuContent.displayName = "DropdownMenuContent";
+
+export default MenuContent;
diff --git a/src/components/dropdownMenu/DropdownMenuItem.tsx b/src/components/dropdownMenu/DropdownMenuItem.tsx
index 4f8db982..9a8e9246 100644
--- a/src/components/dropdownMenu/DropdownMenuItem.tsx
+++ b/src/components/dropdownMenu/DropdownMenuItem.tsx
@@ -1,10 +1,10 @@
import React from "react";
+import {
+ getDrodownMenuItemClassName,
+ useHandleDropdownMenuItemClick,
+} from "./common";
import MenuItemContent from "./DropdownMenuItemContent";
-export const getDrodownMenuItemClassName = (className = "") => {
- return `dropdown-menu-item dropdown-menu-item-base ${className}`.trim();
-};
-
const DropdownMenuItem = ({
icon,
onSelect,
@@ -14,15 +14,17 @@ const DropdownMenuItem = ({
...rest
}: {
icon?: JSX.Element;
- onSelect: () => void;
+ onSelect: (event: Event) => void;
children: React.ReactNode;
shortcut?: string;
className?: string;
-} & React.ButtonHTMLAttributes