projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.61k stars 1.17k forks source link

Use mouse wheel/trackpad scroll to pan the canvas instead of click and drag #664

Open xiaopow opened 4 years ago

xiaopow commented 4 years ago

Is there a way to move the canvas with mouse wheel / trackpad scroll inside of click and drag?

dylanvorster commented 3 years ago

You will need to create a new state-machine drag-state for this instead of the standard states. I think there is a PR that was opened a long time ago which aimed to support mobile events, which will include touch events.

dominiczy commented 3 years ago

Any updates on this?

kobajs commented 3 years ago

@renato-bohler is it, somehow, related to mobile events that you're doing?

renato-bohler commented 3 years ago

@renato-bohler is it, somehow, related to mobile events that you're doing?

Not directly... but in order to achieve dragging the canvas with the scroll wheel click, I believe we would need a very similar implementation.