From def789cd7edcd904aac56750fd58db63dfae38d2 Mon Sep 17 00:00:00 2001 From: Cristiano Santos Date: Mon, 19 Mar 2018 02:10:36 -0700 Subject: [PATCH] Wrong height when TextInput has an empty string Summary: The caret/cursor did not appear when the TextInput was empty. Found that the cause was because the frame of the TextInput had an height of 0 Just fill and clear a TextInput and the caret/cursor will always appear there. [IOS] [BUGFIX] [TextInput] - This was causing the cursor/caret to not appear since the size of the frame had an height of 0. Closes https://github.com/facebook/react-native/pull/18355 Differential Revision: D7319723 Pulled By: shergin fbshipit-source-id: b0249ab5493b6ac310d1898ff20c0bad78cf82c9 --- Libraries/Text/TextInput/RCTBaseTextInputShadowView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m b/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m index d1fdbcd3d..f5a7ca172 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m @@ -180,8 +180,8 @@ // Placeholder also can represent the intrinsic size when it is visible. NSString *text = self.placeholder; if (!text.length) { - // Zero-width space - text = @"\u200B"; + // Note: `zero-width space` is insufficient in some cases. + text = @"I"; } attributedText = [[NSAttributedString alloc] initWithString:text attributes:self.textAttributes.effectiveTextAttributes]; }