Skip to content

Commit

Permalink
Show table header context menu on left click (as well as right)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jun 12, 2022
1 parent d22127e commit 23ce181
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions webview/src/experiments/components/table/TableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ const TableHeaderCell: React.FC<{
<ContextMenu
content={menuContent}
disabled={menuDisabled || menuSuppressed}
trigger={'contextmenu click'}
>
<div
{...column.getHeaderProps(
Expand Down
6 changes: 4 additions & 2 deletions webview/src/shared/components/contextMenu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ export interface ContextMenuProps {
content?: React.ReactNode
disabled?: boolean
onShow?: () => void
trigger?: string
}

export const ContextMenu: React.FC<ContextMenuProps> = ({
children,
content,
disabled,
onShow
onShow,
trigger = 'contextmenu'
}) => (
<Tooltip
arrow
trigger={'contextmenu'}
trigger={trigger}
delay={[100, 200]}
placement={'bottom'}
interactive
Expand Down

0 comments on commit 23ce181

Please sign in to comment.