react / react/react-native

Children inherit parent's properties when parent has boxShadow + scale + overflow:hidden

Offen
#54,612 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Flow Issue: Author Provided Repro Needs: React Native Team Attention
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

When a parent View has all three of these properties:

  • boxShadow
  • transform: [{ scale }] ← Required to trigger the bug
  • overflow: 'hidden'

Children incorrectly inherit the parent's borderRadius and scale transform(and others properties if set), even though these properties should not be inherited.

Additional Context

Removing any one of these properties makes the bug disappear

  • Removing overflow: 'hidden' makes the bug disappear
  • Removing boxShadow makes the bug disappear
  • Removing transform: scale makes the bug disappear

Everything works great on Android

Steps to reproduce
  1. Create a parent View with these exact properties:
    overflow: 'hidden'
    boxShadow: ...
    transform: [{ scale: ... }]
  2. Create a child View inside the parent with:
    borderRadius: 0 (should be square)
  3. Run the app on iOS/tvOS
React Native Version

0.81.4

Affected Platforms

Build - MacOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.1
  CPU: (11) arm64 Apple M3 Pro
  Memory: 161.42 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.18.0
    path: ~/.nvm/versions/node/v22.18.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.3
    path: ~/.nvm/versions/node/v22.18.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.1
      - iOS 26.1
      - macOS 26.1
      - tvOS 26.1
      - visionOS 26.1
      - watchOS 26.1
  Android SDK:
    API Levels:
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-30 | Android TV Intel x86 Atom
      - android-34 | Android TV ARM 64 v8a
      - android-34 | Android TV Intel x86 Atom
      - android-34 | Google APIs ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.19072.14.2412.12360217
  Xcode:
    version: 26.1.1/17B100
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 3.4.1
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
no crash
MANDATORY Reproducer

https://snack.expo.dev/@annaryb/graceful-indigo-pizza

Screenshots and Videos
IOS bug ANDROID no bug
Image Image

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Führe zuerst den obligatorischen Snack-Reproducer auf iOS oder tvOS aus und vergleiche dann seine Ausgabe mit Android, während du boxShadow, scale und overflow:hidden variierst. Im Issue werden keine Quelldateien oder Tests genannt. Als erledigt gilt die Aufgabe, wenn die untergeordnete View unter der gemeldeten Kombination nicht mehr borderRadius oder scale des übergeordneten Elements übernimmt, ohne die anderen Plattformen zu beeinträchtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.