Skip to content

Commit

Permalink
add right click context menu on tagInputItem (microsoft#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
yongbing-chen authored Dec 21, 2020
1 parent 6b4b6f6 commit ae4ce9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/react/components/common/tagInput/tagInputItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ export default class TagInputItem extends React.Component<ITagInputItemProps, IT
this.props.onClick(this.props.tag, {clickedDropDown});
}

private handleContextMenu = (e: MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => {
e.preventDefault();
const clickedDropDown = true;
this.props.onClick(this.props.tag, {clickedDropDown});
}

private onColorClick = (e: MouseEvent) => {
e.stopPropagation();

Expand Down Expand Up @@ -171,6 +177,7 @@ export default class TagInputItem extends React.Component<ITagInputItemProps, IT
const spanValue = this.inputElement?.value ?? "";
return (
<div className={"tag-name-container"}
onContextMenu={this.handleContextMenu}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}>
{
Expand Down

0 comments on commit ae4ce9a

Please sign in to comment.