From f3babec7d700b73dcef6e255fbc247d1636248ab Mon Sep 17 00:00:00 2001
From: andrew
Date: Thu, 1 Oct 2020 11:23:52 -0700
Subject: [PATCH] Remove text selection hack for Android as FlatList fixes
everything!
---
.../InvertedFlatList/BaseInvertedFlatList.js | 4 +++-
src/page/home/report/ReportActionItemFragment.js | 16 ++++------------
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/components/InvertedFlatList/BaseInvertedFlatList.js b/src/components/InvertedFlatList/BaseInvertedFlatList.js
index b6a050edd3b2..01f5df1cb194 100644
--- a/src/components/InvertedFlatList/BaseInvertedFlatList.js
+++ b/src/components/InvertedFlatList/BaseInvertedFlatList.js
@@ -137,9 +137,11 @@ class BaseInvertedFlatList extends Component {
renderItem={this.renderItem}
getItemLayout={this.getItemLayout}
bounces={false}
- removeClippedSubviews
maxToRenderPerBatch={15}
updateCellsBatchingPeriod={40}
+
+ // Setting removeClippedSubviews will break text selection on Android
+ removeClippedSubviews={false}
/>
);
}
diff --git a/src/page/home/report/ReportActionItemFragment.js b/src/page/home/report/ReportActionItemFragment.js
index 548967d312eb..54954d68cc40 100644
--- a/src/page/home/report/ReportActionItemFragment.js
+++ b/src/page/home/report/ReportActionItemFragment.js
@@ -1,7 +1,7 @@
import React from 'react';
import HTML from 'react-native-render-html';
import {
- Linking, ActivityIndicator, View, Platform, Dimensions
+ Linking, ActivityIndicator, View, Dimensions
} from 'react-native';
import PropTypes from 'prop-types';
import Str from '../../../lib/Str';
@@ -86,9 +86,7 @@ class ReportActionItemFragment extends React.PureComponent {
return fragment.html !== fragment.text
? (
)
: (
-
+
{Str.htmlDecode(fragment.text)}
);
case 'TEXT':
return (
{Str.htmlDecode(fragment.text)}