@@ -4,11 +4,7 @@ import React from "react";
44import { ComponentProps , Color , mergeComponentProps } from "../../utils" ;
55import * as Radix from "@radix-ui/react-context-menu" ;
66import "./ContextMenu.style.scss"
7- import { Card } from "../card/Card" ;
8- import { Flex } from "../flex/Flex" ;
9- import { Badge } from "../badge/Badge" ;
10- import { IconArrowDown , IconArrowUp , IconCornerDownLeft } from "@tabler/icons-react" ;
11- import { Spacing } from "../spacing/Spacing" ;
7+ import { AutoScrollArea } from "../scroll-area/ScrollArea" ;
128
139export type ContextMenuProps = ComponentProps & Radix . ContextMenuProps
1410export type ContextMenuTriggerProps = ComponentProps & Radix . ContextMenuTriggerProps
@@ -40,8 +36,13 @@ export const ContextMenuPortal: React.FC<ContextMenuPortalProps> = (props) => {
4036}
4137
4238export const ContextMenuContent : React . FC < ContextMenuContentProps > = ( props ) => {
39+ const { children, ...rest } = props
4340 return < Radix . ContextMenuContent
44- align = { props . align } { ...mergeComponentProps ( `context-menu__content context-menu__content--${ props . color ?? "primary" } ` , props ) as ContextMenuContentProps } />
41+ align = { props . align } { ...mergeComponentProps ( `context-menu__content context-menu__content--${ props . color ?? "primary" } ` , rest ) as ContextMenuContentProps } >
42+ < AutoScrollArea >
43+ { children }
44+ </ AutoScrollArea >
45+ </ Radix . ContextMenuContent >
4546}
4647
4748export const ContextMenuLabel : React . FC < ContextMenuLabelProps > = ( props ) => {
@@ -65,7 +66,12 @@ export const ContextMenuSubTrigger: React.FC<ContextMenuSubTriggerProps> = (prop
6566}
6667
6768export const ContextMenuSubContent : React . FC < ContextMenuSubContentProps > = ( props ) => {
68- return < Radix . ContextMenuSubContent align = { props . align } { ...mergeComponentProps ( `context-menu__sub-content context-menu__sub-content--${ props . color ?? "primary" } ` , props ) as ContextMenuSubContentProps } />
69+ const { children, ...rest } = props
70+ return < Radix . ContextMenuSubContent align = { props . align } { ...mergeComponentProps ( `context-menu__sub-content context-menu__sub-content--${ props . color ?? "primary" } ` , rest ) as ContextMenuSubContentProps } >
71+ < AutoScrollArea >
72+ { children }
73+ </ AutoScrollArea >
74+ </ Radix . ContextMenuSubContent >
6975}
7076
7177export const ContextMenuSeparator : React . FC < ContextMenuSeparatorProps > = ( props ) => {
0 commit comments