diff --git a/Examples/UIExplorer/TextExample.android.js b/Examples/UIExplorer/TextExample.android.js index c557162b7e..230bd79bb1 100644 --- a/Examples/UIExplorer/TextExample.android.js +++ b/Examples/UIExplorer/TextExample.android.js @@ -378,6 +378,11 @@ var TextExample = React.createClass({ No maximum lines specified no matter now much I write here. If I keep writing it{"'"}ll just keep going and going + + + This text is selectable if you click-and-hold, and will offer the native Android selection menus. + + This text contains an inline image . Neat, huh? diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index aab015b6b3..9abd4127b8 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -31,6 +31,7 @@ const viewConfig = { numberOfLines: true, lineBreakMode: true, allowFontScaling: true, + selectable: true, }), uiViewClassName: 'RCTText', }; @@ -95,6 +96,11 @@ const Text = React.createClass({ * This function is called on long press. */ onLongPress: React.PropTypes.func, + /** + * Lets the user select text, to use the native copy and paste functionality. + * @platform android + */ + selectable: React.PropTypes.bool, /** * When true, no visual change is made when text is pressed down. By * default, a gray oval highlights the text on press down. diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java index eabbf7b62a..97e780a6d0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java @@ -112,6 +112,11 @@ public class ReactTextViewManager extends BaseViewManager