You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Click and hold to select text using a text component #13938
I want click-and-hold-to-select-text using a Text component and then i searched it and i found selectable property.It good works but it copy the entire text field.I want to selecting a subset of the text field for copying.Actually this question is asked on stackoverflow .Here is question on stackoverflow:http://stackoverflow.com/a/37119619/4596143
This full of text ("text description") can copy not partially .I want to it like screenshot
Actual behaviour:
Expected behavior:
Solution
They are said that RN 0.39 adds support to copy the entire text field, but does not yet include support for selecting a subset of the text field for copying on stackoverflow .I wonder Text component include support for selecting a subset of the text field for copying on new versions for react native.If the property does not exist on new versions ,will the property for text integrate ?
This issue looks like a question and not an actual bug report. Please try asking over on Stack Overflow instead.
Reacted by PetrK, Arseny Yankovsky, Maksym Lysenko, Walter Monecke, yanyixin, David, Emily Presser, William Candillon, fenglu09, Aleksey Gurtovoy and 54 more
It's only needed on Android, and works as a drop-in replacement for a TextInput with these specific values on iOS, as TextInput with editable: false already works correctly there. TextInput on Android either fills most of the screen with the keyboard, or disables the ability to select and respond to selection changes. I would assume this component only works well for the specific use-case I had, haven't tested it for any other prop values.
Use a <TextInput/> on iOS to allow multiple actions and use a regular <Text/> on Android. That will allow specific word selection on both platforms. No linking. No native libraries. Just use this:
import{Platform}from'react-native';// ...{Platform.OS==='ios' ? (// iOS requires a textinput for word selections<TextInputvalue={description}editable={false}multiline/>) : (// Android can do word selections just with <Text><Textselectable>{description}</Text>)}
Result, Android:
Result, iOS:
Reacted by Rohan Talip, rechardcheng12345, Ilia Sidorenko, Ethan Millstein, emmanuel-ma, Tạ Trường, Emmanuel Guyot, Kay Gosho, gwalshington, Yarmukhametov Rinat and 10 more
Reacted by Nam Pham, Greg Blake, Tạ Trường, Hend El-Sahli, Kay Gosho, xxxcc, Thach Nguyen, patrick lehmann and Burak
@acro5piano TextInput cannot be nested in another TextInput. Un-nest your texts to make them selectable. If you need rich text formatting I unfortunately don't have an answer.
@hoanvnbkaselectable is a react native feature that's usually reliable on iOS. On Android, the Emulator tends to stop responding to the long press after a while, so you'll need to restart the emulator to fix it. If you still need help, you need to provide more information than 'did not work'. Try posting on Stack Overflow with the solution I gave, a detailed explanation of the problem and what you tried to fix it.
Thanks for the issue. I have been contributing to facebook/react-native for 4 years and specialize in the Text/TextInput components. I currently have 58 facebook/react-native PRs:
Use a <TextInput/> on iOS to allow multiple actions and use a regular <Text/> on Android. That will allow specific word selection on both platforms. No linking. No native libraries. Just use this:
import{Platform}from'react-native';// ...{Platform.OS==='ios' ? (// iOS requires a textinput for word selections<TextInputvalue={description}editable={false}multiline/>) : (// Android can do word selections just with <Text><Textselectable>{description}</Text>)}
Result, Android:
Result, iOS:
@scarlac Are you aware of a way to make the <TextInput/> component selectable in iOS without having multiline set? In a few of my components I don't want text to wrap, but I'd still like the visible text to be selectable.
@johnlahut i'am not currently aware of a method but I haven't checked since that post so perhaps there are ways now that I'm not aware of. If you find one please share.
Use a <TextInput/> on iOS to allow multiple actions and use a regular <Text/> on Android. That will allow specific word selection on both platforms. No linking. No native libraries. Just use this:
import{Platform}from'react-native';// ...{Platform.OS==='ios' ? (// iOS requires a textinput for word selections<TextInputvalue={description}editable={false}multiline/>) : (// Android can do word selections just with <Text><Textselectable>{description}</Text>)}
Result, Android:
Result, iOS:
This worked for me. Thanks 👍 . For me adding scrollEnabled={false} to the TextInput also helped with some undesired scrolling..
This works (mostly, it's a WIP but also not much time to fully implement everything) on iOS for text selection. Uses RN Text on Android and web since no changes are needed there, and a native component on iOS that uses UITextView over UILabel. We are using this in production though right now with no issues.
Contribs are more than welcome if you want to clean it up! Some styles are missing, etc. right now.
@fabOnReact Totally feel free to take it and clean it up if you ever want to. From what I've seen you do a lot of good work with Text so you probably have a way better idea of how to implement this than I do ❤️ (same to anyone else)
Reacted by Jacob Mølby, abing, Rui Gomes, Henning Hall, Jesse Katsumata, btoo, Meabu and Sergey Rozhkov
Reacted by Liam Jones, Chris Zubak-Skees, Tim Etler, mattvr, Jesse Katsumata, btoo, Sam Tsai and Meabu
In our case we need to have text formatting, and because the value of a TextInput can only be a string the workaround doesn't work. It would be great to have Text working on iOS the way it does on Android.
surprised & devastated that this is not a react native feature :(
+1 to prioritize this since text is a fundamental piece of most apps and should be fully natively supported
@cortinico, @cipolleschi, there is another issue reported citing the exact same behaviour. Looking forward to hear your opinion and conclude this issue.
What should we make of this? 9+ years. A fair point would be that if 'we' all want it so much, 'we' should code it up. But solutions have been made, yet no real progress has been done.
Doesn't anyone find this strange? These long issues (e.g., the Gnome file picker thumbnail fiasco) are so universally wanted and objectively needed but remain frozen for decades.
I think a new field of open source anthropology should start; I suspect there is more here than meets the eye.
Activity
fenglu09 commentedon Apr 20, 2018
@yasemincidem Have you found a solution?
react-native-bot commentedon May 7, 2018
This issue looks like a question and not an actual bug report. Please try asking over on Stack Overflow instead.
BichCNTT commentedon May 9, 2018
Hello guys,
How I can get the word selected when set selectable={true}
Can you tell me?
Ths.
ethanleeX commentedon Jun 14, 2018
@BichCNTT you can try this status-im/status-legacy#3616
wcandillon commentedon Aug 2, 2018
@react-native-bot this issue should be reopened
Exposed scrollEnabled on TextInput (#19330)
Exposed scrollEnabled on TextInput (#19330)
singhsoldier13 commentedon Aug 16, 2018
+1
thinhtrh commentedon Sep 5, 2018
+1
yusent commentedon Sep 19, 2018
+1
ezrra commentedon Sep 19, 2018
+1
axelfrid commentedon Oct 23, 2018
+1
j-ornelas commentedon Nov 16, 2018
+1
xinfang commentedon Nov 27, 2018
+1
mraak commentedon Nov 27, 2018
+1
AbdelhalimAhmed commentedon Nov 27, 2018
+1
jeongsd commentedon Nov 28, 2018
+1
kala888 commentedon Nov 29, 2018
this issue should be reopened again
kala888 commentedon Nov 29, 2018
Here is a temporary solution。
msand commentedon Dec 12, 2018
I've published a workaround for now if you're interested: https://github.com/msand/react-native-selectable-text
It's only needed on Android, and works as a drop-in replacement for a TextInput with these specific values on iOS, as TextInput with editable: false already works correctly there. TextInput on Android either fills most of the screen with the keyboard, or disables the ability to select and respond to selection changes. I would assume this component only works well for the specific use-case I had, haven't tested it for any other prop values.
zhouanbo commentedon Dec 21, 2018
My solution is to use https://www.npmjs.com/package/react-native-webview-autoheight and load text as html.
kkusanagi commentedon May 28, 2019
React-Native 0.59 version. Only show COPY when long press.
Edit: Seems only work for Android version. IOS don't have this feature.
scarlac commentedon Aug 12, 2019
Use a
<TextInput/>on iOS to allow multiple actions and use a regular<Text/>on Android. That will allow specific word selection on both platforms. No linking. No native libraries. Just use this:Result, Android:

Result, iOS:

hoanvnbka commentedon Aug 16, 2019
I test version 0.59.10 but
selectabledid not work. Does anyone have same error?acro5piano commentedon Nov 26, 2019
@scarlac
Thanks for the workaround. How do you treat nested
<TextInput />? It seems to accept type ofstring.scarlac commentedon Nov 26, 2019
@acro5piano TextInput cannot be nested in another TextInput. Un-nest your texts to make them selectable. If you need rich text formatting I unfortunately don't have an answer.
@hoanvnbka
selectableis a react native feature that's usually reliable on iOS. On Android, the Emulator tends to stop responding to the long press after a while, so you'll need to restart the emulator to fix it. If you still need help, you need to provide more information than 'did not work'. Try posting on Stack Overflow with the solution I gave, a detailed explanation of the problem and what you tried to fix it.acro5piano commentedon Nov 26, 2019
@scarlac
Thank you for your answer!
fabOnReact commentedon Jan 18, 2024
Hello,
Thanks for the issue. I have been contributing to facebook/react-native for 4 years and specialize in the Text/TextInput components. I currently have 58 facebook/react-native PRs:
https://github.com/facebook/react-native/pulls?q=is%3Apr+author%3Afabriziobertoglio1987+
It is the suggested approach from the react-native core team (see this discussion).
I'm publishing several fixes for Text and TextInput component in a separate library react-native-improved.
The advantages would be:
Do you want me to publish for you a patched release? I'm working on a list of priorities. Thanks
johnlahut commentedon Feb 20, 2024
@scarlac Are you aware of a way to make the
<TextInput/>component selectable in iOS without havingmultilineset? In a few of my components I don't want text to wrap, but I'd still like the visible text to be selectable.scarlac commentedon Feb 21, 2024
@johnlahut i'am not currently aware of a method but I haven't checked since that post so perhaps there are ways now that I'm not aware of. If you find one please share.
AkbarBakhshi commentedon Mar 12, 2024
This worked for me. Thanks 👍 . For me adding
scrollEnabled={false}to the TextInput also helped with some undesired scrolling..haileyok commentedon Mar 19, 2024
Dropping this here https://github.com/bluesky-social/react-native-uitextview
This works (mostly, it's a WIP but also not much time to fully implement everything) on iOS for text selection. Uses RN
Texton Android and web since no changes are needed there, and a native component on iOS that usesUITextViewoverUILabel. We are using this in production though right now with no issues.Contribs are more than welcome if you want to clean it up! Some styles are missing, etc. right now.
@fabOnReact Totally feel free to take it and clean it up if you ever want to. From what I've seen you do a lot of good work with
Textso you probably have a way better idea of how to implement this than I do ❤️ (same to anyone else)lsarni commentedon Jul 11, 2024
In our case we need to have text formatting, and because the value of a
TextInputcan only be astringthe workaround doesn't work. It would be great to haveTextworking on iOS the way it does on Android.bubblesunyum commentedon Jul 29, 2024
surprised & devastated that this is not a react native feature :(
+1 to prioritize this since text is a fundamental piece of most apps and should be fully natively supported
princektripathi commentedon Nov 14, 2024
Hello @cipolleschi , @cortinico,
I debugged the partial text selection issue because it intrigued me, especially since it’s been open since 2017. Here are my findings:
RCTParagraphTextViewextendsUIView, which does not support partial text selection.UITextView. Also, neitherTextnor anyViewin SwiftUI supports partial selection.Possible Solution
UITextView.UIView.Cons
UITextViewcould limit the flexibility of custom drawing we initially intended by extendingUIView.UITextViewI created a sample app showcasing all major combinations of selectable texts:
UITextView,UIView(manual text selection handling).Text,UIViewRepresentable(manual text selection handling).Sample - https://github.com/PrinceK001/RNPlayground
Could you please validate my understanding?
API Ref -

princektripathi commentedon Nov 15, 2024
@cortinico, @cipolleschi, there is another issue reported citing the exact same behaviour. Looking forward to hear your opinion and conclude this issue.
#33494
react-native-bot commentedon May 15, 2025
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
react-native-bot commentedon May 22, 2025
This issue was closed because it has been stalled for 7 days with no activity.
lsarni commentedon May 22, 2025
The issue isn't resolved
ashutoshup99 commentedon Jul 22, 2025
Is there any solution for this till now ?
colaquecez commentedon Oct 5, 2025
I created that lib for android: https://github.com/colaquecez/expo-selectable-text, but I need to spend more time on it to make it better.
react-native-bot commentedon Apr 3, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
CanRau commentedon Apr 4, 2026
Please don't close
elstgav commentedon Apr 13, 2026
This is still an issue: #55187 - Text prop selectable not working since upgrade on iOS 26
aretrace commentedon Apr 20, 2026
What should we make of this? 9+ years. A fair point would be that if 'we' all want it so much, 'we' should code it up. But solutions have been made, yet no real progress has been done.
Doesn't anyone find this strange? These long issues (e.g., the Gnome file picker thumbnail fiasco) are so universally wanted and objectively needed but remain frozen for decades.
I think a new field of open source anthropology should start; I suspect there is more here than meets the eye.
raajnadar commentedon Sep 6, 2026
I tried to solve #58363. Can someone look into it?