react / react/react-native

[iOS] Background appearing outside of border when using border radius

オープン
#53,814 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Issue: Author Provided Repro Needs: React Native Team Attention Platform: iOS
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Note: I already created an issue for expo https://github.com/expo/expo/issues/39711. On request of intergalacticspacehighway I am creating an issue here so it can be fixed in react native.

Description

Add view with border and border radius where the border color is the background color. Then the border will have a outline / glass like effect on iOS but not on web. I am not sure if this is a bug in expo or rather in react native.

I stumbled on this because I use a border like this to put a text badge on an icon and use the border on the text to make it have a nice offest on the icon like here:

Image
Steps to reproduce

Add view with border and border radius where the border color is the background color:

        <View
            style={{
                width: 50,
                height: 50,
                backgroundColor: 'red',
                borderStyle: 'solid',
                borderWidth: 10,
                borderColor: 'white',
                borderRadius: 25,
            }}
        ></View>

Then the border will have a outline / glass like effect on iOS but not on web. I am not sure if this is a bug in expo or rather in react native.

React Native Version

0.81.4

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.0
  CPU: (10) arm64 Apple M1 Max
  Memory: 8.64 GB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.12.0
    path: ~/.nvm/versions/node/v22.12.0/bin/node
  Yarn:
    version: 4.8.1
    path: ~/.nvm/versions/node/v22.12.0/bin/yarn
  npm:
    version: 10.9.0
    path: ~/.nvm/versions/node/v22.12.0/bin/npm
  Watchman:
    version: 2024.11.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/dennis/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK:
    API Levels:
      - "28"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 32.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-30 | Google Play ARM 64 v8a
      - android-32 | Google APIs ARM 64 v8a
      - android-32 | Google Play ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 26.0/17A324
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 3.1.4
    path: /Users/dennis/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.4
    wanted: 0.81.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
No crash
MANDATORY Reproducer

https://github.com/denniske/expo-border-glass-repro

Screenshots and Videos

Web:
Image

iOS:
Image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

github.com/denniske/expo-border-glass-repro にある必須の reproducer と、borderWidth、borderColor、borderRadius、backgroundColor を使用する View のスタイルから始めます。React Native 0.81.4 で iOS と Web のレンダリングを比較します。iOS の border に、角丸の border の外側にある望ましくないガラスのようなアウトラインが表示されなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ios, react-native
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。