Permalink
Browse files

Expose pressRetentionOffset for Text

Summary:
expose this property to make Text having same property like TouchableHighlight
Closes #11473

Differential Revision: D4348825

fbshipit-source-id: 941bcc681139d4460f52fed5174be1d2381462c7
  • Loading branch information...
evollu authored and facebook-github-bot committed Dec 19, 2016
1 parent a19c699 commit 550469bb823592797c4c16090dd46b4d6bc3850f
Showing with 10 additions and 1 deletion.
  1. +10 −1 Libraries/Text/Text.js
View
@@ -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;

0 comments on commit 550469b

Please sign in to comment.