Skip to content

Commit

Permalink
Fix #2987: Datascroller do not reset first on lazy (#3442)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 8, 2022
1 parent 6b323ac commit 95015b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion components/lib/datascroller/DataScroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ export const DataScroller = React.memo(
if (props.value) {
value.current = props.value;

first.current = 0;
if (!props.lazy) {
first.current = 0;
}

dataToRender.current = [];
handleDataChange();
}
Expand Down
18 changes: 9 additions & 9 deletions components/lib/datascroller/datascroller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ interface DataScrollerLazyLoadParams {
}

export interface DataScrollerProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
value?: any[];
rows?: number;
inline?: boolean;
scrollHeight?: string;
loader?: boolean;
buffer?: number;
header?: React.ReactNode;
children?: React.ReactNode;
emptyMessage?: DataScrollerEmptyMessageType;
footer?: React.ReactNode;
header?: React.ReactNode;
inline?: boolean;
lazy?: boolean;
emptyMessage?: DataScrollerEmptyMessageType;
onLazyLoad?(e: DataScrollerLazyLoadParams): void;
loader?: boolean;
rows?: number;
scrollHeight?: string;
value?: any[];
itemTemplate?(item: any): React.ReactNode;
children?: React.ReactNode;
onLazyLoad?(e: DataScrollerLazyLoadParams): void;
}

export declare class DataScroller extends React.Component<DataScrollerProps, any> {
Expand Down

0 comments on commit 95015b6

Please sign in to comment.