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

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

Menu hide itself when zoom in graph #74

Open Nicolas-PredictaLab opened 1 year ago

Nicolas-PredictaLab commented 1 year ago

Hello,

image

I've a very long submenu under "Social" submenu and I've managed to set a height and a overflow-y : auto in CSS but whenever I scroll in the submenu, the graph itself if zooming and then, menu closed itself. Everything is 'normal' from what I've seen in the library code, but how to prevent this ? I see 2 ways :

Thanks for feedbacks, Have a nice day.

Nicolas-PredictaLab commented 1 year ago

An hacky way if to do like this :

// Disable zooming when user open the submenu
cy.on('cxttap', () => cy.userZoomingEnabled(false))
// Enable it again when user tap or modify viewport
cy.on('tap viewport', () => cy.userZoomingEnabled(true))