mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Extend Text to support measurement of empty Texts
Summary: This diff extends the measurement of Text components in order to support empty strings. This is required for parity with Paper. I created a follow up task to analyze support of empty string as part of the Text infrastructure of Fabric in the future. changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D21761171 fbshipit-source-id: d2aa074052b09732af5d35723f19014090fcabbf
This commit is contained in:
committed by
Facebook GitHub Bot
parent
34b23c1220
commit
4b596fd5b3
+3
-1
@@ -62,6 +62,8 @@ AttributedString AndroidTextInputShadowNode::getAttributedString() const {
|
||||
// single character in the string so that the measured height is greater
|
||||
// than zero. Otherwise, empty TextInputs with no placeholder don't
|
||||
// display at all.
|
||||
// TODO T67606511: We will redefine the measurement of empty strings as part
|
||||
// of T67606511
|
||||
AttributedString AndroidTextInputShadowNode::getPlaceholderAttributedString()
|
||||
const {
|
||||
// Return placeholder text, since text and children are empty.
|
||||
@@ -70,7 +72,7 @@ AttributedString AndroidTextInputShadowNode::getPlaceholderAttributedString()
|
||||
fragment.string = getConcreteProps().placeholder;
|
||||
|
||||
if (fragment.string.empty()) {
|
||||
fragment.string = " ";
|
||||
fragment.string = BaseTextShadowNode::getEmptyPlaceholder();
|
||||
}
|
||||
|
||||
auto textAttributes = TextAttributes::defaultTextAttributes();
|
||||
|
||||
Reference in New Issue
Block a user