Moveable
    Preparing search index...

    Interface ScrollableProps

    interface ScrollableProps {
        getScrollPosition?: (
            e: { direction: number[]; scrollContainer: HTMLElement },
        ) => number[];
        onScroll?: (e: OnScroll) => any;
        onScrollGroup?: (e: OnScrollGroup) => any;
        scrollable?: boolean;
        scrollContainer?: MoveableRefType<HTMLElement>;
        scrollOptions?: Partial<DragScrollOptions> | null;
        scrollThreshold?: number;
        scrollThrottleTime?: number;
    }

    Hierarchy (View Summary)

    Index
    getScrollPosition?: (
        e: { direction: number[]; scrollContainer: HTMLElement },
    ) => number[]

    Sets a function to get the scroll position.

    scrollContainer's scrollTop, scrollLeft
    
    onScroll?: (e: OnScroll) => any

    When the drag cursor leaves the scrollContainer, the scroll event occur to scroll.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: document.querySelector(".target"),
    });
    moveable.on("scroll", ({ scrollContainer, direction }) => {
    scrollContainer.scrollLeft += direction[0] * 10;
    scrollContainer.scrollTop += direction[1] * 10;
    });
    onScrollGroup?: (e: OnScrollGroup) => any

    When the drag cursor leaves the scrollContainer, the scrollGroup event occur to scroll in group.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: [].slice.call(document.querySelectorAll(".target")),
    });
    moveable.on("scroll", ({ scrollContainer, direction }) => {
    scrollContainer.scrollLeft += direction[0] * 10;
    scrollContainer.scrollTop += direction[1] * 10;
    });
    scrollable?: boolean

    Whether or not target can be scrolled to the scroll container

    false
    
    scrollContainer?: MoveableRefType<HTMLElement>

    The container to which scroll is applied

    container
    
    scrollOptions?: Partial<DragScrollOptions> | null

    Option to scroll with dragging

    0.43.0

    const scrollOptions = {
    container: () => viewer.getContainer(),
    threshold: 20,
    getScrollPosition: () => {
    return [
    viewer.getScrollLeft({ absolute: true }),
    viewer.getScrollTop({ absolute: true }),
    ];
    },
    };
    scrollThreshold?: number

    Expand the range of the scroll check area.

    0
    
    scrollThrottleTime?: number

    Time interval that occurs when scrolling occurs when dragging is maintained If set to 0, it does not occur.

    0