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

[Bug]: maxFontSizeMultiplier is not being respected #47499

Open
mysport12 opened this issue Nov 8, 2024 · 7 comments
Open

[Bug]: maxFontSizeMultiplier is not being respected #47499

mysport12 opened this issue Nov 8, 2024 · 7 comments
Labels
Component: Text Component: TextInput Related to the TextInput component. Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Attention Issues where the author has responded to feedback. Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@mysport12
Copy link
Contributor

Description

The maxFontSizeMultiplier prop is not being respected for Text and TextInput components. When accessibility settings are changed to increase the display text, the font size increases beyond the multiplier set.

Steps to reproduce

  • Init a new project from the CLI template
  • Add a few Text/TextInput components to the screen
  • Prevent some from scaling and allow others to scale with the maxFontSizeMultiplier prop passed
  • Change OS accessibility settings from display text size and observe bug

React Native Version

0.76.1

Affected Platforms

Runtime - Android, Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 15.0.1
  CPU: (12) arm64 Apple M3 Pro
  Memory: 107.84 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.1.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 4.5.1
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.10.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/craig/.rvm/gems/ruby-3.3.5/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK:
    API Levels:
      - "23"
      - "24"
      - "25"
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 29.0.3
      - 30.0.1
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
    System Images:
      - android-28 | Google Play Intel x86 Atom
      - android-29 | Google APIs Intel x86 Atom
      - android-29 | Google Play Intel x86 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-30 | Google APIs Intel x86_64 Atom
      - android-30 | Google Play Intel x86 Atom
      - android-30 | Google Play Intel x86 Atom_64
      - android-33 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12550806
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 3.3.5
    path: /Users/craig/.rvm/rubies/ruby-3.3.5/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0
    wanted: 15.0.0
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No logs

Reproducer

https://github.com/mysport12/maxFontSizeMultiplierBug

Screenshots and Videos

image
image

@mysport12 mysport12 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Nov 8, 2024
@mysport12 mysport12 changed the title Bug: maxFontSizeMultiplier is not being respected [Bug]: maxFontSizeMultiplier is not being respected Nov 8, 2024
@cortinico
Copy link
Contributor

The maxFontSizeMultiplier prop is not being respected for Text and TextInput components. When accessibility settings are changed to increase the display text, the font size increases beyond the multiplier set.

Is this working well if you turn off the New Architecture? Asking to understand if this is a Fabric regression or not

@mysport12
Copy link
Contributor Author

@cortinico It is working properly on the legacy architecture in 0.75.4.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Nov 8, 2024
@cortinico
Copy link
Contributor

@cortinico It is working properly on the legacy architecture in 0.75.4.

And how about legacy arch on 0.76?

@mysport12
Copy link
Contributor Author

Yes, I can confirm it is working on 0.76.1 with the legacy arch.

@migueldaipre migueldaipre added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Component: TextInput Related to the TextInput component. Component: Text labels Nov 12, 2024
RickardZrinski added a commit to RickardZrinski/react-native that referenced this issue Nov 12, 2024
RickardZrinski added a commit to RickardZrinski/react-native that referenced this issue Nov 12, 2024
@RickardZrinski
Copy link

RickardZrinski commented Nov 12, 2024

I've added support (RickardZrinski@140d9eb) and hoping to open a pull request tomorrow. Just need to do some more manual testing / compare with the old architecture and do some screenshots for the PR.

Edit: still working on it :)

@hungnd-casso
Copy link

hungnd-casso commented Nov 14, 2024

I've added support (RickardZrinski@140d9eb) and hoping to open a pull request tomorrow. Just need to do some more manual testing / compare with the old architecture and do some screenshots for the PR.

Edit: still working on it :)

image

@RickardZrinski
Copy link

RickardZrinski commented Nov 14, 2024

Everything is working on Android and iOS, except that there is some weirdness happening on the new architecture with reapplying changes made in Settings when switching back to the app (e.g. you've changed font size in accessibility settings but you need to restart the app for it to apply).

I don't think this issue is specific to my PR but rather a general issue in the new architecture. Though I'll need to verify that to be sure.

Edit: yeah, the reapplying of settings is a general issue on the new architecture. On iOS you can switch back and forth to your app after changing Settings and usually after the second roundtrip it gets applied. On Android it does apply after returning from Settings, but line height (seemingly) is messed up until you restart the app. I should probably open an issue on this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Text Component: TextInput Related to the TextInput component. Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Attention Issues where the author has responded to feedback. Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

5 participants