Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to prevent panning and generally interacting with the Svelvet canvas? #480

Open
metroite opened this issue Oct 18, 2023 · 1 comment

Comments

@metroite
Copy link

When there is a Svelvet canvas on the website, that canvas prevents the default behaiviour of scrolling with mouse wheel and instead zooms out in the canvas which are both undesirable. Is it possible to prevent every interaction with a Svelvet canvas and instead use the standard initial view set by the developer (possibly set to fitView)?

@jagwarrx
Copy link

jagwarrx commented Oct 26, 2023

I have the same requirement. The Svelvet component has a fixedZoom property that prevents zoom. It's not in the documentation, and I've opened a request to update documentation: #482

To prevent pan, I've tried two methods - adding css style pointer-events: none to the parent div, and adding an overlay component with high z-index on top of the canvas. Both don't seem to have an effect on the panning. It does seem v6 has a method to disable pan

If the canvas is optional, take a look at https://anseki.github.io/leader-line/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants