How to set options for autoScroll of canvas?

Hi, anyone knows how to set options for autoScroll of canvas?
The code may looks like this:

const autoScroll = this.modeler.get("autoScroll");

The reason I ask this is I want to disable the LEFT autoScroll of canvas when an element is being dragged to the left edge of the canvas.


There is no such functionality. You’d have to override AutoScroll with your custom auto scroll.

Thank you for your quick reply.

Where could I find an example on how to override AutoScroll?

There’s no such example.

In general, overriding auto scroll works like overriding any other module:

const modeler = new Modeler({
  additionalModules: [
      __depends__: [ DraggingModule ],
      __init__: [ 'autoScroll' ],
      autoScroll: [ 'type', MyCustomAutoScroll ]

Make sure to use the same name autoScroll to override the existing module with the same name.

That is great! Thank you for your help!

If I just want to disable the autoScroll of canvas, is there an easy way to do it?

Change the module to

  autoScroll: [ 'value', null ]

to disable the module. Works with any module. :wink:

Perfect! Thank you so much for your help!