Skip to content

Text: adjustsFontSizeToFit just redrawing won't recalculate the layout #14812

Open
@iamAbhi-916

Description

@iamAbhi-916

Problem Description

adjustsFontSizeToFit affects the actual text layout calculation - it may change the font size used to fit the text within the available space
Simply redrawing won't recalculate the layout with the new sizing behavior.

if (oldViewProps.paragraphAttributes.adjustsFontSizeToFit != newViewProps.paragraphAttributes.adjustsFontSizeToFit) {

Steps To Reproduce

text sample from playground.

Expected Results

recalculate the layout when the text is sized to fit within its container not just redraw.

CLI version

17.0.0

Environment

S C:\Users\abhijeetjha\Documents\RNW\react-native-windows> npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26100
  CPU: "(16) x64 AMD EPYC 7763 64-Core Processor                "
  Memory: 38.25 GB / 63.95 GB
Binaries:
  Node:
    version: 18.20.8
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: C:\ProgramData\global-npm\yarn.CMD
  npm:
    version: 10.8.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
      - 10.0.26100.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.14.36127.28 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target React Native Architecture

New Architecture (WinAppSDK) Only

Target Platform Version

None

Visual Studio Version

Visual Studio 2022 Preview

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

Metadata

Metadata

Assignees

Labels

Needs: Triage 🔍New issue that needs to be reviewed by the issue management team (label applied by bot)bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions