Skip to content

Commit

Permalink
Merge pull request #2 from abhinandvk/patch-1
Browse files Browse the repository at this point in the history
Update index.tsx
  • Loading branch information
abhi3691 authored Sep 4, 2024
2 parents d09d0aa + deb4ced commit efae270
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/template/recycler/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import type { DimProps, RecyclerProps, RecyclerState } from './props';
class Recycler extends Component<RecyclerProps, RecyclerState> {
layoutProvider: LayoutProvider;
state: RecyclerState;
scrollViewRef:any ;


constructor(props: any) {
super(props);
Expand Down Expand Up @@ -111,6 +113,16 @@ class Recycler extends Component<RecyclerProps, RecyclerState> {
});
}

scrollToEnd() {
if (this.scrollViewRef.current) {
setTimeout(() => {
this.scrollViewRef.current._scrollViewRef.scrollToEnd({animated:true})

}, 500);
}
}


render() {
const { dataList, list, loading } = this.state;
return (
Expand All @@ -129,6 +141,9 @@ class Recycler extends Component<RecyclerProps, RecyclerState> {
forceNonDeterministicRendering={
this.props?.forceNonDeterministicRendering ?? true
}
ref={ref => {
this.scrollViewRef = ref;
}}
scrollViewProps={this.props?.scrollViewProps}
isHorizontal={this.props?.horizontal}
showsVerticalScrollIndicator={false}
Expand Down

0 comments on commit efae270

Please sign in to comment.