fix: prevent the native context menu from appearing when right-clicking on a measurement or angle (https://github.com/OHIF/Viewers/issues/1406) (#1469)

This commit is contained in:
arthur-miller 2020-02-29 10:59:47 -03:00 committed by GitHub
parent 06075ecb51
commit 9b3be9b0c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -1,11 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import './ContextMenu.css';
const ContextMenu = ({ items, onClick }) => {
return (
<div className="ContextMenu">
<div className="ContextMenu" onContextMenu={e => e.preventDefault()}>
<ul>
{items.map((item, index) => (
<li key={index}>

View File

@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { commandsManager } from './../App.js';
import { ContextMenu } from '@ohif/ui';
import PropTypes from 'prop-types';
import React from 'react';
import { commandsManager } from './../App.js';
const toolTypes = [
'Angle',
@ -94,7 +93,7 @@ const ToolContextMenu = ({
return (
<div className="ToolContextMenu">
<ContextMenu items={dropdownItems} onClick={onClickHandler} />;
<ContextMenu items={dropdownItems} onClick={onClickHandler} />
</div>
);
};