Bugfix: Make iOS Slider it the responder

Summary:This fixes issues with other view (like the Navigator) stealing the responder and becoming interactive while the user is dragging the slider.

From [documentation](https://facebook.github.io/react-native/docs/gesture-responder-system.html):
- `onStartShouldSetResponder`: Does this view want to become responder on the start of a touch? -> Yes.
- `onResponderTerminationRequest`: Something else wants to become responder. Should this view release the responder? -> No.

Reviewed By: ericvicenti

Differential Revision: D3133337

fb-gh-sync-id: 3d7e1e6a2ed6fa605857cfb0549ffa71df85fd22
fbshipit-source-id: 3d7e1e6a2ed6fa605857cfb0549ffa71df85fd22
This commit is contained in:
Martin Konicek 2016-04-04 08:23:10 -07:00 committed by Facebook Github Bot 2
parent 2f2703936d
commit 52ddfd9b51

View File

@ -131,7 +131,11 @@ var SliderIOS = React.createClass({
onSlidingComplete && onSlidingComplete(event.nativeEvent.value);
});
return <RCTSlider {...props}/>;
return <RCTSlider
{...props}
onStartShouldSetResponder={() => true}
onResponderTerminationRequest={() => false}
/>;
}
});