From 5017b86b525e3ef6023f0f8a88e6fd1cf98024e0 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Wed, 27 Jun 2018 19:55:27 -0700 Subject: [PATCH] Fix extreme TextInput slowness on Android (#19645) Summary: This reverts 5898817fc "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 https://github.com/facebook/react-native/pull/19645 Differential Revision: D8675230 Pulled By: hramos fbshipit-source-id: e2c2d352ee781898721b2dff4738572d1a6b7471 --- .../com/facebook/react/views/text/ReactBaseTextShadowNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java index 075c5be23edf3c..f6a8885d12f204 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java @@ -119,7 +119,7 @@ private static void buildSpannedFromShadowNode( start, end, new BackgroundColorSpan(textShadowNode.mBackgroundColor))); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - if (textShadowNode.mLetterSpacing != Float.NaN) { + if (!Float.isNaN(textShadowNode.mLetterSpacing)) { ops.add(new SetSpanOperation( start, end,