react-native icon indicating copy to clipboard operation
react-native copied to clipboard

adjustsFontSizeToFit not working as expected on Android

Open vikalinic opened this issue 5 months ago • 1 comments

Description

On Android devices when adjustsFontSizeToFit is set to Text component, text is missing and not resized. Tested on version 0.73.1 and 0.73.4 Working as expected on iOS and Android with old Arch. On Expo Snack working as expected.

Steps to reproduce

    <Text
      style={styles.textStyle}
      adjustsFontSizeToFit
      numberOfLines={1}>
      Some random big text 
    </Text>
    
    .....
    

const styles = StyleSheet.create({ textStyle: { color: 'white', fontSize: 50, }, });

React Native Version

0.73.1

Affected Platforms

Runtime - Android

Areas

Fabric - The New Renderer, JSI - Javascript Interface

Output of npx react-native info

System:
  OS: macOS 14.2.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 170.55 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.5.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.4
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "34"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.1
    wanted: 0.73.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

-

Reproducer

https://snack.expo.dev/iJlK5wo96XDF2FPlYXbIc?platform=android

Screenshots and Videos

Android Screenshot 2024-02-19 at 16 06 24

iOS Screenshot 2024-02-19 at 16 06 24

vikalinic avatar Feb 20 '24 07:02 vikalinic

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.4. 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.

github-actions[bot] avatar Feb 20 '24 07:02 github-actions[bot]

Related to #42044

cortinico avatar Mar 25 '24 18:03 cortinico

Oh, I believe I need to comment on the issue for you to be able to assign me @cortinico.

j-piasecki avatar Apr 09 '24 08:04 j-piasecki

Oh, I believe I need to comment on the issue for you to be able to assign me @cortinico.

Exactly :)

cortinico avatar Apr 09 '24 09:04 cortinico