Skip to content

Views with a specific non-transparent background color are being incorrectly flattened #51378

@rubennorte

Description

@rubennorte

Description

I noticed that, when using rgba(255, 255, 255, ${127/256}) as the background color of a view that just has dimensions and background color, the view is being flattened by Fabric and not mounted on the host platform.

In this image, the black rectangle in the middle of the gradient is the one using that color:

Image

Steps to reproduce

Render a view using that color:

return (
  <View style={{
    backgroundColor: `rgba(255, 255, 255, ${127/256})`,
    width: 50,
    height: 50,
  }} />
)

React Native Version

All

Affected Platforms

Runtime - Desktop, Runtime - iOS, Runtime - Android

Output of npx @react-native-community/cli info

N/A

Stacktrace or Logs

N/A

MANDATORY Reproducer

N/A

Screenshots and Videos

Already attached

Metadata

Metadata

Assignees

Labels

BugNeeds: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.Resolution: PR SubmittedA pull request with a fix has been provided.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions