Skip to content

Commit

Permalink
[VirtualList]: added docs to the ScrollToConfig interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuznietsov committed Oct 16, 2023
1 parent 4765297 commit 749cd2a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions uui-core/src/types/dataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,25 @@ export interface VirtualListRange {

export type ScrollAlign = 'top' | 'nearest';

/**
* Holds configuration of the force scrolling behavior.
*/
export interface ScrollToConfig {
/** Index of the row to be scrolled to. */
index?: number;

/** Scrolling movement behavior. */
behavior?: ScrollBehavior;

/** Alignment behavior. This property specifies, to which position a row with an index should be scrolled to.
* @default 'top'
*
* If `nearest` is specified, a list will be scrolled to a row in the nearest position only if row is not visible.
* If a row is closer to the bottom, the list will be scrolled to the row in the bottom position of a scroll container.
* If closer to the top, will be scrolled to the row in the top position.
*
* If `top` is specified, scrolling a list to a row to the top part of the container will happen in any case.
*/
align?: ScrollAlign;
}

Expand Down

0 comments on commit 749cd2a

Please sign in to comment.