Skip to content

Commit 5017b86

Browse files
gnpricefacebook-github-bot
authored andcommitted
Fix extreme TextInput slowness on Android (#19645)
Summary: This reverts 5898817 "Implement letterSpacing on Android >= 5.0". Testing shows that that commit is the cause of #19126, where in a controlled TextInput after some text is first added, then deleted, further interaction with the TextInput becomes extremely slow. Fixes #19126. Tried the repro case from #19126 without this change, then with it. The issue reproduces, then doesn't. Closes #19645 Differential Revision: D8675230 Pulled By: hramos fbshipit-source-id: e2c2d352ee781898721b2dff4738572d1a6b7471
1 parent b3ef1c3 commit 5017b86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private static void buildSpannedFromShadowNode(
119119
start, end, new BackgroundColorSpan(textShadowNode.mBackgroundColor)));
120120
}
121121
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
122-
if (textShadowNode.mLetterSpacing != Float.NaN) {
122+
if (!Float.isNaN(textShadowNode.mLetterSpacing)) {
123123
ops.add(new SetSpanOperation(
124124
start,
125125
end,

0 commit comments

Comments
 (0)