Skip to content

Commit fc82240

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Fix measuring text with incorrect hyphenationFrequency
Summary: A typo means TextLayoutManager will incorrectly measure text as if `LineBreaker.HYPHENATION_FREQUENCY_NORMAL` is set, instead of the correct default of `LineBreaker.HYPHENATION_FREQUENCY_NONE` which we use to display the `TextView`. This causes truncation if hyphenation would have caused text to be shorter than if not hyphenated. Fix the typo. Changelog: [Android][Fixed] - Fix measuring text with incorrect hyphenationFrequency Reviewed By: mellyeliu Differential Revision: D63293027 fbshipit-source-id: baaf2ae2676548cf0815ae96e324af273be6f99e
1 parent 7ab0002 commit fc82240

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public static Layout createLayout(
455455
? paragraphAttributes.getBoolean(PA_KEY_INCLUDE_FONT_PADDING)
456456
: DEFAULT_INCLUDE_FONT_PADDING;
457457
int hyphenationFrequency =
458-
TextAttributeProps.getTextBreakStrategy(
458+
TextAttributeProps.getHyphenationFrequency(
459459
paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY));
460460
boolean adjustFontSizeToFit =
461461
paragraphAttributes.contains(PA_KEY_ADJUST_FONT_SIZE_TO_FIT)

0 commit comments

Comments
 (0)