* Scrolls the slider to the specified destination with updating indices. * * @param destination - The position to scroll the slider to. * @param duration - Optional. Specifies the scroll duration. * @param snap - Optional. Whether to snap the slider to the closest slide or not.
( destination: number, duration?: number, snap?: boolean, callback?: AnyFunction )
| 150 | * @param callback - Optional. A callback function invoked after scroll ends. |
| 151 | */ |
| 152 | function scroll( destination: number, duration?: number, snap?: boolean, callback?: AnyFunction ): void { |
| 153 | Components.Scroll.scroll( destination, duration, snap, () => { |
| 154 | const index = loop( Move.toIndex( getPosition() ) ); |
| 155 | setIndex( omitEnd ? min( index, endIndex ) : index ); |
| 156 | callback && callback(); |
| 157 | } ); |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * Parses the control and returns a slide index. |
no test coverage detected
searching dependent graphs…