You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using cytoscape core in my vue application and it appears that the cytoscape div does not propagate the rightclick event. Can somebody let me know how to show the default browser right click menu upon right clicking on cy?
Are all events prevented from being defaulted within cytoscape?
Thanks in Advance
This what I have tried:
<div ref="cy" />
import cytoscape, {Core, EventObject, LayoutOptions, NodeDefinition, EdgeDefinition} from 'cytoscape';
const el = <HTMLElement>(<any>this.$refs.cy);
this.cy = CytoscapeSingleton.initializeCytoscape(el);
//this.cy.removeAllListeners(); //tried this did not help
this.cy.on('cxttap', this.onRightClick);
onRightClick(e: EventObject) {
this.cy.unbind('contextmenu'); //Did not help
}
Edit: I managed to do this to override the default suppression of right click menu
this.cy.container()?.addEventListener('contextmenu', (e)=>{e.stopImmediatePropagation()}, true);
however the right click now only shows 3 options on right-clicking the canvas :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi All ,
I am using cytoscape core in my vue application and it appears that the cytoscape div does not propagate the rightclick event. Can somebody let me know how to show the default browser right click menu upon right clicking on cy?
Are all events prevented from being defaulted within cytoscape?
Thanks in Advance
This what I have tried:
Edit: I managed to do this to override the default suppression of right click menu
this.cy.container()?.addEventListener('contextmenu', (e)=>{e.stopImmediatePropagation()}, true);
How do I enable the full right-click menu pls?
Beta Was this translation helpful? Give feedback.
All reactions