Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Arch][Android] After turning on fabric, the text in the Xiaomi MIUI13 system is not fully displayed #48320

Open
peaktan opened this issue Dec 18, 2024 · 4 comments
Labels
Newer Patch Available Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@peaktan
Copy link

peaktan commented Dec 18, 2024

Description

On Xiaomi MIUI13 system, when the font weight is changed and the fontWeight of the Text component is set to blod, the Text text will be truncated and wrapped;
If numberOfLines is set to 1, a different phenomenon will occur, causing the end of the text to become an ellipsis and incomplete display.

MIUI 14 seems to have problems as well, and other devices have not been tested.

This problem only occurs when a new architecture is enabled. There is no problem if newArchEnabled is set to false.

This is the system information:

Screenshot_20241218_191907

Set the thickness to maximum:

Screenshot_20241218_192042

Steps to reproduce

  1. Do not set numberOfLines, and the line will be truncated directly.
<View style={{
              paddingHorizontal: 12,
              marginHorizontal: 4,
              alignItems: "center",
              justifyContent: "center",
              height: 26
            }}>
              <Text style={{
                fontSize: 13,
                fontWeight: "bold",
                backgroundColor: 'red',
              }}>已取件(粗体),未设置了numberOfLines * 121221</Text>
            </View>

2、Set numberOfLines to 1, and an ellipsis appears at the end

<View style={{
              paddingHorizontal: 12,
              marginHorizontal: 4,
              alignItems: "center",
              justifyContent: "center",
              height: 26
            }}>
              <Text style={{
                fontSize: 13,
                fontWeight: "bold",
                backgroundColor: 'red',
              }} numberOfLines={1}>已取件(粗体),设置了numberOfLines=1 * 121221</Text>
            </View>

React Native Version

0.74.1

Affected Platforms

Runtime - Android

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 13.4
  CPU: (10) arm64 Apple M2 Pro
  Memory: 123.03 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.0.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 8.6.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/01400926/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 14.3/14E222b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/01400926/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

Reproducer

https://github.com/peaktan/fontDemo

Screenshots and Videos

code:

 <View style={{
              paddingHorizontal: 12,
              marginHorizontal: 4,
              alignItems: "center",
              justifyContent: "center",
              height: 26
            }}>
              <Text style={{
                fontSize: 13,
                fontWeight: "bold",
                backgroundColor: 'red',
              }}>已取件(粗体),未设置了numberOfLines * 121221</Text>
            </View>
            <View style={{
              paddingHorizontal: 12,
              marginHorizontal: 4,
              alignItems: "center",
              justifyContent: "center",
              height: 26
            }}>
              <Text style={{
                fontSize: 13,
                fontWeight: "bold",
                backgroundColor: 'red',
              }} numberOfLines={1}>已取件(粗体),设置了numberOfLines=1 * 121221</Text>
            </View>

result:

Screenshot_20241218_193516

@peaktan peaktan added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Dec 18, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added the Platform: Android Android applications. label Dec 18, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@sarthak-d11
Copy link
Contributor

Hi @peaktan,
Could you please try testing the issue on React Native version 0.76.5? It would be really helpful to narrow down the cause.

@peaktan
Copy link
Author

peaktan commented Dec 27, 2024

Hi @peaktan, Could you please try testing the issue on React Native version 0.76.5? It would be really helpful to narrow down the cause.

ok,I'll give you a reply after I try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Newer Patch Available Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants