Skip to content

Commit

Permalink
Expose pressRetentionOffset for Text
Browse files Browse the repository at this point in the history
Summary:
expose this property to make Text having same property like TouchableHighlight
Closes #11473

Differential Revision: D4348825

fbshipit-source-id: 941bcc681139d4460f52fed5174be1d2381462c7
  • Loading branch information
Libin Lu authored and facebook-github-bot committed Dec 19, 2016
1 parent a19c699 commit 550469b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Libraries/Text/Text.js
Expand Up @@ -11,6 +11,7 @@
*/
'use strict';

const EdgeInsetsPropType = require('EdgeInsetsPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 550469b

Please sign in to comment.