Skip to content

Commit

Permalink
Add context menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskerr committed Mar 16, 2022
1 parent bc01602 commit bd54116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/demo/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function App() {
width={props.width}
height={props.height}
onClick={() => console.log("clicked!")}
onContextMenu={() => console.log("context menu")}
>
{Node}
</Tree>}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-arborist/src/components/tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const OuterElement = forwardRef(function Outer(
const tree = useStaticContext();
return (
// @ts-ignore
<div ref={ref} {...rest} onClick={tree.onClick}>
<div ref={ref} {...rest} onClick={tree.onClick} onContextMenu={tree.onContextMenu}>
<div
style={{
height: tree.api.visibleNodes.length * tree.rowHeight,
Expand Down

0 comments on commit bd54116

Please sign in to comment.