Skip to content

Commit 853074d

Browse files
fred2028Facebook Github Bot 5
authored andcommitted
Pass along scrollResponder()
Summary: Allows calls to `scrollResponder()` without crashing Reviewed By: fkgozali Differential Revision: D3293272 fbshipit-source-id: c46d99c0d7430a37fc364fa3aaf77dd192d7ab37
1 parent 2c3ca4c commit 853074d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Libraries/Experimental/SwipeableRow/SwipeableListView.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ const SwipeableListView = React.createClass({
4646
},
4747
},
4848

49+
_listViewRef: (null: ?string),
50+
4951
propTypes: {
5052
dataSource: PropTypes.object.isRequired, // SwipeableListViewDataSource
5153
maxSwipeDistance: PropTypes.number,
@@ -79,12 +81,22 @@ const SwipeableListView = React.createClass({
7981
return (
8082
<ListView
8183
{...this.props}
84+
ref={(ref) => {
85+
this._listViewRef = ref;
86+
}}
8287
dataSource={this.state.dataSource}
8388
renderRow={this._renderRow}
8489
/>
8590
);
8691
},
8792

93+
// Passing through ListView's getScrollResponder() function
94+
getScrollResponder(): ?Object {
95+
if (this._listViewRef && this._listViewRef.getScrollResponder) {
96+
return this._listViewRef.getScrollResponder();
97+
}
98+
},
99+
88100
_renderRow(rowData: Object, sectionID: string, rowID: string): ReactElement {
89101
const slideoutView = this.props.renderQuickActions(rowData, sectionID, rowID);
90102

0 commit comments

Comments
 (0)