Skip to content

Text's padding doesn't affect views inside Text component #42099

@kasperski95

Description

@kasperski95

Description

  1. Text padding doesn't affect placeholders/attachments inside a Text component when a new architecture is enabled. It works on old architecture (Snack runs on old architecture hence the problem is not visible there). Tested only on Android.

  2. This may also affect out-of-tree RN platforms, because TextLayoutManager.cpp::measure doesn't provide info about padding.

Steps to reproduce

  1. Enable new architecture on Android
  2. Add a view inside a text component
  3. Add padding to the text component

Padding doesn't affect the view, but it affects the text.

React Native Version

0.73.1

Affected Platforms

Runtime - Android

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 14.0
  CPU: (8) arm64 Apple M2
  Memory: 83.16 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: ~/.asdf/installs/nodejs/18.19.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.2.5
    path: ~/.asdf/plugins/nodejs/shims/npm
  Watchman:
    version: 2023.08.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 34.0.0
    System Images:
      - android-33 | Android TV ARM 64 v8a
      - android-33 | Android TV Intel x86 Atom
      - android-33 | Google TV ARM 64 v8a
      - android-33 | Google TV Intel x86 Atom
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google APIs Intel x86_64 Atom
      - android-33 | Google Play ARM 64 v8a
      - android-33 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/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: Not found
  newArchEnabled: false

Stacktrace or Logs

-

Reproducer

https://snack.expo.dev/2inl-9JbA

Screenshots and Videos

New architecture:
Screenshot 2023-12-29 at 15 28 39

Old architecture:
Screenshot 2023-12-29 at 15 29 23

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.Resolution: FixedA PR that fixes this issue has been merged.Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions