iVis-at-Bilkent / cytoscape.js-context-menus

A Cytoscape.js extension to provide context menu around elements and core instance
MIT License
86 stars 41 forks source link

TypeError: Illegal constructor in Safari on desktop #55

Open JoinThisBand opened 3 years ago

JoinThisBand commented 3 years ago

In Safari on desktop an Illegal constructor error is thrown, which prevents the menu from working:

Screenshot 2020-11-24 at 18 01 02

All of your demos seem to be affected - happy to help with any further information.

Thanks

msalihaltun commented 3 years ago

I think this issue is caused by the usage of custom elements. I'm not sure we can polyfill it in a simple way, maybe we can use this polyfill but we need to be aware of this section in their README as we are using constructors (this is the reason it might be complicated to go for a polyfill solution?).

lbakke commented 3 years ago

I'm also getting this issue in Electron.

ugurdogrusoz commented 3 years ago

@ClientsideDesign @lbakke unfortunately we don't have resources to work on this at the moment. Feel free to make a patch and issue a PR on the unstable branch if you like.

lbakke commented 3 years ago

ok, no problem. @ugurdogrusoz I see that you're also involved with development for cytoscape-edge-editing, could you tell me if you can use edge-editing in any extent without the use of context-menu's in the cytoscape graph?

ugurdogrusoz commented 3 years ago

@lbakke in fact none of our extensions depend on each other and all should be compatible with our knowledge. Enjoy! :)

lbakke commented 3 years ago

Okay, thank you! However when I try using edge-editing with the default parameters, right-clicking on an edge produces the error "contextMenus is not a function" which is why I thought it context-menu was necessary in order to use edge-editing. Is there a way to add bend points or remove them without using context-menu?

ugurdogrusoz commented 3 years ago

You are right I completely forgot that we need the context menus to facilitate adding and removing bend / control points.

msalihaltun commented 3 years ago

Can confirm that this issue is still persistent with latest version of Safari.

matthughes commented 2 years ago

Can someone point to the real source code of where this is blowing up? From what I gather, Safari supports custom elements, but doesn't support overriding existing elements (e.g., input, select). Is this project trying to override a built-in element or a custom one?

matthughes commented 2 years ago

And does anyone have a good way to check for this support so we can at least show the graph without the context menus. Otherwise the whole page blows up.

JoinThisBand commented 2 years ago

@matthughes - did you see the polyfill suggestion on here? Not tried it myself. https://github.com/danieldietrich/candid/issues/17#issuecomment-1028455087

sveinp commented 2 years ago

The suggestion seems to work in our case at least.

JoshuaeKaiser commented 2 years ago

This

@matthughes - did you see the polyfill suggestion on here? Not tried it myself. danieldietrich/candid#17 (comment)

This worked for me also. Not ideal, but atleast its a workaround.