Skip to content

Commit b070ded

Browse files
authored
Merge pull request #201 from plotly/ctx-menu-safari-polyfill
Add polyfill to fix context-menu extension in Safari
2 parents 58d88cf + d4eb346 commit b070ded

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"author-email": "[email protected]",
3838
"license": "MIT",
3939
"dependencies": {
40+
"@ungap/custom-elements": "^1.3.0",
4041
"cytoscape-cola": "^2.5.1",
4142
"cytoscape-context-menus": "^4.1.0",
4243
"cytoscape-cose-bilkent": "^4.1.0",
@@ -56,9 +57,9 @@
5657
"devDependencies": {
5758
"@babel/core": "^7.23.0",
5859
"@babel/eslint-parser": "^7.22.15",
59-
"babel-loader": "^9.1.3",
6060
"@babel/preset-env": "^7.22.20",
6161
"@babel/preset-react": "^7.22.15",
62+
"babel-loader": "^9.1.3",
6263
"copyfiles": "^2.4.1",
6364
"css-loader": "^6.8.1",
6465
"eslint": "^8.50.0",
@@ -82,4 +83,4 @@
8283
"node": ">=8.11.0",
8384
"npm": ">=6.1.0"
8485
}
85-
}
86+
}

src/lib/components/Cytoscape.react.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import CytoscapeComponent from 'react-cytoscapejs';
99
import _ from 'lodash';
1010
import {v4 as uuidv4} from 'uuid';
1111
import CyResponsive from '../cyResponsive.js';
12+
13+
// Polyfill so that context menu extension works in Safari
14+
import '@ungap/custom-elements';
15+
1216
const cytoscape = require('cytoscape');
1317
const contextMenus = require('cytoscape-context-menus');
1418

0 commit comments

Comments
 (0)