From f276425ab866d933d9ee00cf48dea5296fa5d0b5 Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Mon, 7 Nov 2016 18:01:09 -0800 Subject: [PATCH] Stop other views from stealing the responder from PickerIOS and DatePickerIOS Summary: Similar to https://github.com/facebook/react-native/commit/52ddfd9b51cbaa05176efc8c9dfa7b581be01a97 the `DatePickerIOS` and `PickerIOS` components need to stop the propagation of swiping gestures in order to prevent other views from responding to them. This is most noticable when placed inside a modal behind a scrollView.
Before After
Closes https://github.com/facebook/react-native/pull/10768 Differential Revision: D4142351 Pulled By: spicyj fbshipit-source-id: 22395aefaf46179bf2f77031c329209d4c33ee71 --- Libraries/Components/DatePicker/DatePickerIOS.ios.js | 2 ++ Libraries/Components/Picker/PickerIOS.ios.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index 0c5749394..c8024048c 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -134,6 +134,8 @@ const DatePickerIOS = React.createClass({ minuteInterval={props.minuteInterval} timeZoneOffsetInMinutes={props.timeZoneOffsetInMinutes} onChange={this._onChange} + onStartShouldSetResponder={() => true} + onResponderTerminationRequest={() => false} /> ); diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index d37cdf614..12bbc2cc1 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -62,6 +62,8 @@ var PickerIOS = React.createClass({ items={this.state.items} selectedIndex={this.state.selectedIndex} onChange={this._onChange} + onStartShouldSetResponder={() => true} + onResponderTerminationRequest={() => false} /> );