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

border-color opacity level is not visible when a background-color without opacity is set on the same view (iOS) #39286

Closed
flo-sch opened this issue Sep 5, 2023 · 6 comments
Labels
Needs: Triage 🔍 Newer Patch Available Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@flo-sch
Copy link

flo-sch commented Sep 5, 2023

Description

On a given <View />, when applying a background color without opacity, together with a border-color having an opacity level, the border-color appears opaque on iOS, while it appears as expected on Android.

<View
  style={{
    width: 20,
    height: 20,
    borderRadius: 10,
    backgroundColor: 'rgb(208, 12, 123)',
    borderStyle: 'solid',
    borderWidth: 2,
    borderColor: 'rgba(208, 12, 123, 0.2)',
  }}
/>

As shown on the screenshots below, the border-color has a visual opacity value on Android, but is rendered "opaque" on iOS, as if the opacity of the background-color takes over the opacity of the border-color.

react-native-border-color-opacity-android react-native-border-color-opacity-ios

It is possible to workaround that for my case by adding the opaque background on a child View, but I am interested to know whether this is intentional behaviour or not.

React Native Version

0.71.11

Output of npx react-native info

info Fetching system and libraries information...
System:
    OS: macOS 13.5.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 22.72 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.12.0 - /[...]/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.3 AI-223.8836.35.2231.10671973
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Java: 20.0.1 - /usr/local/opt/openjdk/bin/javac
  npmPackages:
    @react-native-community/cli: 10.1.3 => 10.1.3 
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.11 => 0.71.11 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

  • Implement a View of any dimension
  • Give it an opaque background-color (ex rgb(255, 0, 0))
  • Give it a border of style solid, a width, and an non-opaque background-color (ex: rgba(255, 0, 0, 0.2))
  • Compare how it visually differs between Android and iOS

Snack, screenshot, or link to a repository

https://snack.expo.dev/@flo-sch/react-native-background-vs-border-color-opacity

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.71.13. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@github-actions github-actions bot added the Platform: iOS iOS applications. label Sep 5, 2023
@flo-sch
Copy link
Author

flo-sch commented Sep 5, 2023

Potentially related to #34722, without certitude?

Copy link

github-actions bot commented Mar 4, 2024

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 4, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
@dani-mp
Copy link

dani-mp commented May 9, 2024

I can repro this as well.

@AlixH
Copy link

AlixH commented Feb 3, 2025

Up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Newer Patch Available Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants