Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multigrid support onScroll #536

Merged
merged 2 commits into from
Jan 12, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/MultiGrid/MultiGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ export default class MultiGrid extends Component {
fixedRowCount,
rowCount,
scrollToColumn,
scrollToRow
scrollToRow,
onScroll
} = props

return (
Expand All @@ -433,7 +434,7 @@ export default class MultiGrid extends Component {
columnCount={columnCount - fixedColumnCount}
columnWidth={this._columnWidthRightGrid}
height={this._getBottomGridHeight(props)}
onScroll={this._onScroll}
onScroll={(info) => {this._onScroll(info);onScroll && onScroll(info)}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving this into the _onScroll method? That way the code's a bit easier to read and we avoid creating a new wrapper function on each render. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, i thought the _onScroll has been used not only in bottomRight grid, also in other grid. And the passed onScroll only should use in one Grid.
I will update it.

ref={this._bottomRightGridRef}
rowCount={rowCount - fixedRowCount}
rowHeight={this._rowHeightBottomGrid}
Expand Down