Skip to content

Commit 83d6ac0

Browse files
committed
fix: textTransform not working on Android in new arch
1 parent 118e651 commit 83d6ac0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class TextAttributeProps {
5959
public static final short TA_KEY_ACCESSIBILITY_ROLE = 24;
6060
public static final short TA_KEY_LINE_BREAK_STRATEGY = 25;
6161
public static final short TA_KEY_ROLE = 26;
62+
public static final short TA_KEY_TEXT_TRANSFORM = 27;
6263

6364
public static final int UNSET = -1;
6465

@@ -217,14 +218,16 @@ public static TextAttributeProps fromMapBuffer(MapBuffer props) {
217218
case TA_KEY_ROLE:
218219
result.setRole(Role.values()[entry.getIntValue()]);
219220
break;
221+
case TA_KEY_TEXT_TRANSFORM:
222+
result.setTextTransform(entry.getStringValue());
223+
break;
220224
}
221225
}
222226

223227
// TODO T83483191: Review why the following props are not serialized:
224228
// setNumberOfLines
225229
// setColor
226230
// setIncludeFontPadding
227-
// setTextTransform
228231
return result;
229232
}
230233

packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ constexpr static MapBuffer::Key TA_KEY_LAYOUT_DIRECTION = 23;
970970
constexpr static MapBuffer::Key TA_KEY_ACCESSIBILITY_ROLE = 24;
971971
constexpr static MapBuffer::Key TA_KEY_LINE_BREAK_STRATEGY = 25;
972972
constexpr static MapBuffer::Key TA_KEY_ROLE = 26;
973+
constexpr static MapBuffer::Key TA_KEY_TEXT_TRANSFORM = 27;
973974

974975
// constants for ParagraphAttributes serialization
975976
constexpr static MapBuffer::Key PA_KEY_MAX_NUMBER_OF_LINES = 0;
@@ -1077,6 +1078,11 @@ inline MapBuffer toMapBuffer(const TextAttributes& textAttributes) {
10771078
TA_KEY_LINE_BREAK_STRATEGY,
10781079
toString(*textAttributes.lineBreakStrategy));
10791080
}
1081+
if (textAttributes.textTransform.has_value()) {
1082+
builder.putString(
1083+
TA_KEY_TEXT_TRANSFORM, toString(*textAttributes.textTransform));
1084+
}
1085+
10801086
// Decoration
10811087
if (textAttributes.textDecorationColor) {
10821088
builder.putInt(

0 commit comments

Comments
 (0)