Skip to content

Commit

Permalink
Implement onScrollToIndexFailed instead of getItemLayout due to incon…
Browse files Browse the repository at this point in the history
…sistencies
  • Loading branch information
zanechua committed Jul 17, 2019
1 parent 6610ce5 commit 1e591d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions library/SearchList.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,7 @@ export default class SearchList extends Component {
ListFooterComponent={this.props.renderFooter || this._renderFooter.bind(this)}
ListHeaderComponent={this.props.renderHeader || this._renderHeader.bind(this)}

getItemLayout={(data, index) => {
const itemSeparatorHeight = 1 / PixelRatio.get();
const itemHeight = rowHeight + itemSeparatorHeight;
return ({
length: itemHeight,
offset: itemHeight * index,
index
});
}}
onScrollToIndexFailed={()=>{}}
/>
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zanechua/react-native-search-list",
"version": "2.3.1",
"version": "2.3.2",
"description": "react native component for search list view",
"main": "./library/index.js",
"scripts": {
Expand Down

0 comments on commit 1e591d6

Please sign in to comment.