From 86f1d570ebfed92bc9db0505a99fa3a07bdc6ab9 Mon Sep 17 00:00:00 2001 From: Tyler Wanek Date: Tue, 15 Aug 2017 09:40:36 -0700 Subject: [PATCH 1/2] add onWheel prop --- source/Grid/Grid.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/Grid/Grid.js b/source/Grid/Grid.js index 3f3e0fe6b..35e89f4dd 100644 --- a/source/Grid/Grid.js +++ b/source/Grid/Grid.js @@ -144,6 +144,11 @@ type Props = { /** Callback invoked with information about the section of the Grid that was just rendered. */ onSectionRendered: (params: RenderedSection) => void, + /** + * Optional callback invoked whenever onWheel is called. + */ + onWheel?: (params: WheelEvent) => void, + /** * Number of columns to render before/after the visible section of the grid. * These columns can help for smoother scrolling on touch devices or browsers that send scroll events infrequently. @@ -854,6 +859,7 @@ export default class Grid extends React.PureComponent { height, id, noContentRenderer, + onWheel, role, style, tabIndex, @@ -915,6 +921,7 @@ export default class Grid extends React.PureComponent { className={cn("ReactVirtualized__Grid", className)} id={id} onScroll={this._onScroll} + onWheel={onWheel} role={role} style={{ ...gridStyle, From 437bd5fa2486902377a516ae3ab95e1594b9ec2d Mon Sep 17 00:00:00 2001 From: Tyler Wanek Date: Tue, 15 Aug 2017 12:13:18 -0700 Subject: [PATCH 2/2] Expose unfiltered rest prop for grid --- source/Grid/Grid.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/Grid/Grid.js b/source/Grid/Grid.js index 35e89f4dd..b41c92919 100644 --- a/source/Grid/Grid.js +++ b/source/Grid/Grid.js @@ -86,6 +86,9 @@ type Props = { /** Either a fixed column width (number) or a function that returns the width of a column given its index. */ columnWidth: CellSize, + /** Unfiltered props for the Grid container. */ + containerProps?: Object, + /** ARIA role for the cell-container. */ containerRole: string, @@ -144,11 +147,6 @@ type Props = { /** Callback invoked with information about the section of the Grid that was just rendered. */ onSectionRendered: (params: RenderedSection) => void, - /** - * Optional callback invoked whenever onWheel is called. - */ - onWheel?: (params: WheelEvent) => void, - /** * Number of columns to render before/after the visible section of the grid. * These columns can help for smoother scrolling on touch devices or browsers that send scroll events infrequently. @@ -854,12 +852,12 @@ export default class Grid extends React.PureComponent { autoHeight, autoWidth, className, + containerProps, containerRole, containerStyle, height, id, noContentRenderer, - onWheel, role, style, tabIndex, @@ -916,12 +914,12 @@ export default class Grid extends React.PureComponent { return (