From 6d24ee13a47a58ff1b19c5a51f39f52c9a4a8a28 Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Sat, 20 May 2023 18:56:11 -0700 Subject: [PATCH] fix: apply font size to ReactTextView to fix ellipsis cut (#37248) Summary: This PR aims to fix https://github.com/facebook/react-native/issues/36350. In certain cases, when the text is cut due to `numberOfLines`, the ellipsis appear cut. This is actually an Android bug, which was reported on their side [here](https://issuetracker.google.com/issues/278044456). This PR contains a workaround for it by applying the text size to the TextView directly instead of just the Spannable inside it. This solves all problems and it seems like it does not cause any regressions. ## Changelog: [ANDROID] [FIXED] - Fix ellipsis being cut on certain font sizes Pull Request resolved: https://github.com/facebook/react-native/pull/37248 Test Plan: One piece of code where the problem could be replicated would be the one below, running on an Pixel 3A emulator. ```jsx This text will be cut-off strangely in Android ``` RN-tester of the problem: | Before | With the fix | | --------------- | --------------- | | Screenshot 2023-05-04 at 12 05 11| Screenshot 2023-05-04 at 12 08 07 | RN-Tester comparison: | Before | With the fix | | --------------- | --------------- | |