diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 114732763..cb39fc79c 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -11,6 +11,7 @@ */ 'use strict'; +const EdgeInsetsPropType = require('EdgeInsetsPropType'); const NativeMethodsMixin = require('NativeMethodsMixin'); const Platform = require('Platform'); const React = require('React'); @@ -141,6 +142,14 @@ const Text = React.createClass({ * e.g., `onLongPress={this.increaseSize}>`` */ onLongPress: React.PropTypes.func, + /** + * When the scroll view is disabled, this defines how far your touch may + * move off of the button, before deactivating the button. Once deactivated, + * try moving it back and you'll see that the button is once again + * reactivated! Move it back and forth several times while the scroll view + * is disabled. Ensure you pass in a constant to reduce memory allocations. + */ + pressRetentionOffset: EdgeInsetsPropType, /** * Lets the user select text, to use the native copy and paste functionality. */ @@ -266,7 +275,7 @@ const Text = React.createClass({ }; this.touchableGetPressRectOffset = function(): RectOffset { - return PRESS_RECT_OFFSET; + return this.props.pressRetentionOffset || PRESS_RECT_OFFSET; }; } return setResponder;