Skip to content

autoScroll

Karl edited this page Nov 1, 2018 · 21 revisions

Type Object

Enables auto-scrolling of the page or scrolling parent.

The option has two properties:

  • threshold - the number of pixels from the edge of the container before auto-scrolling is started. Defaults to 40. A negative value will trigger autoscroll when the mouse/pointer is outside the container by the defined amount - e.g, a value of -50 will cause autoscrolling to start when the mouse/pointer is 50 pixels above / below the container. This helps prevent autoscroll from triggering when trying to select an item close to the container boundries.
  • increment - the amount in pixels to scroll the container. Defaults to 20.
const selectable = new Selectable({
    autoScroll: {
        threshold: 40,
        increment: 20,
    }
});

Disable

To disable the feature just set the option to false.

const selectable = new Selectable({
    autoScroll: false
});
Clone this wiki locally