question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android: Text component not selectable when removeClippedSubviews

See original GitHub issue

React Native version:

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
    Memory: 22.99 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    npm: 6.12.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 28
      Build Tools: 28.0.3
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 11.2/11B52 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.11.0 => 16.11.0 
    react-native: 0.61.3 => 0.61.3
  npmGlobalPackages:
    create-react-native-app: 2.0.2
    create-react-native-module: 0.10.2
    react-native-cli: 2.0.1

Steps To Reproduce

  1. Render a <Text selectable={true}>test</Text> component inside a ScrollView with removeClippedSubviews={true} on Android
  2. Try to copy paste text. Text is not selectable by long pressing

Describe what you expected to happen: Text should be selectable regardless of removeClippedSubviews

Snack, code example, screenshot, or link to a repository:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
fabriziobertoglio1987commented, Feb 25, 2021

Thanks for the issue report. I tested your used case by adding removeClippedSubviews={true} to the Animated.FlatList component in my branch https://github.com/facebook/react-native/pull/28952

This issue is fixed with https://github.com/facebook/react-native/pull/28952 Thanks a lot

CLICK TO OPEN TESTS RESULTS

the onPressHandler is triggered when we set onPressDisabled: false

AFTER
<video src="https://user-images.githubusercontent.com/24992535/109151707-cc22bf00-776a-11eb-8531-e457d98ce61b.mp4" width="700" height="" />

the text is selected when we set onPressDisabled: false

AFTER
<video src="https://user-images.githubusercontent.com/24992535/109151735-d6dd5400-776a-11eb-8737-8dec54037f19.mp4" width="700" height="" />

0reactions
cristianoccazinspcommented, Jul 18, 2020

Still an issue

El sáb., 18 de julio de 2020 03:07, stale[bot] notifications@github.com escribió:

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community’s attention? This issue may be closed if no further activity occurs. You may also label this issue as a “Discussion” or add it to the “Backlog” and I will leave it open. Thank you for your contributions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/27107#issuecomment-660433999, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALU263FW7KP6WLJOU26TT3LR4E32RANCNFSM4JIXC45Q .

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Text in FlatList is not selectable on Android
I solved this by adding a key prop to the Text component: ... alternative solution is setting removeClippedSubviews={false} on the FlatList.
Read more >
Text - React Native - W3cubDocs
Lets the user select text, to use the native copy and paste functionality. Type, Default. boolean, false. selectionColor. Android.
Read more >
React Native FlatList Component - GeeksforGeeks
Start the server by using the following command. npm run android. Output: If your emulator did not open automatically then you need to...
Read more >
View - React Native
The most fundamental component for building a UI, View is a container that ... View that wraps two colored boxes and a text...
Read more >
FlatList - React Native Archive
More complex, multi-select example demonstrating PureComponent usage for perf ... Without setting this prop, FlatList would not know it needs to re-render ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found