1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 14:21:23 +00:00

optimized code (#4277)

This commit is contained in:
杨顺强
2019-11-20 15:19:47 +08:00
committed by Daniel Pan
parent b7076eee76
commit c3a6ada019

View File

@@ -198,6 +198,10 @@ class ContextMenu extends React.Component {
this.props.onMenuItemClick(operation, currentObject, event);
}
onContextMenu = (event) => {
event.stopPropagation();
}
render() {
const inlineStyle = { position: 'fixed', opacity: 0, pointerEvents: 'none', display: 'block' };
return (
@@ -212,6 +216,7 @@ class ContextMenu extends React.Component {
className="seafile-contextmenu-item dropdown-item"
data-operation={menuItem.key}
onClick={this.onMenuItemClick}
onContextMenu={this.onContextMenu}
>
{menuItem.value}
</button>