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

iOS - borderStyle: 'dashed' and 'dotted' no longer works in combination with overflow: hidden in 0.76 #48078

Open
jorjordandan opened this issue Dec 3, 2024 · 4 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications.

Comments

@jorjordandan
Copy link

Description

After upgrading to expo 52 and react-native 0.76.3 I noticed some of my dashed borders had disappeared in some cases on iOS. On further investigation, I discovered that dashed borders no longer work when borderStyle: "dashed" | "dotted" are used in combination with overflow: "hidden" or overflow: "scroll". Instead of a dashed or dotted border, it shows a solid border.
Dotted and dashed borders work correctly with overflow: "visible"
Dotted and dashed borders also work correctly in android.

I took a cursory look through the source code, but couldn't see the issue - that being said, if someone can point me in somewhat the right direction, I'd be happy to take a swing at a fix.

Steps to reproduce

  1. Install the application and launch ios emulator
  2. look at the code in the stylesheet for the two items
  3. look at the missing borderStyle
Screenshot 2024-12-03 at 12 27 00 PM

React Native Version

0.76.3

Affected Platforms

Runtime - iOS

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.5
  CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
  Memory: 181.07 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: ~/.nvm/versions/node/v18.19.0/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v18.19.0/bin/npm
  Watchman:
    version: 4.9.0
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.10.0
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK: Not Found
IDEs:
  Android Studio: 4.1 AI-201.8743.12.41.6953283
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.1.1
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.3
    wanted: 0.76.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

no logs

Reproducer

https://github.com/jorjordandan/borderIssue

Screenshots and Videos

No response

@react-native-bot react-native-bot added Flow Platform: iOS iOS applications. labels Dec 3, 2024
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 Flow labels Dec 4, 2024
@NickGerleman
Copy link
Contributor

FYI @joevilches (this change may not be related to any of the recent refactoring, since this is going from old arch to new arch).

@joevilches
Copy link
Contributor

@NickGerleman thanks for the callout, I'll take a look regardless!

@zarv1k
Copy link

zarv1k commented Dec 25, 2024

Seems similar to #48392

joevilches added a commit to joevilches/react-native that referenced this issue Dec 30, 2024
Summary:
Was looking into facebook#48078 which was brought to my attention due to my recent refactorings of iOS Views, especially around how overflow: hidden works. This bug was not brought on by my changes but seems to be a lingering Fabric bug (iirc this bool was not changed when I refactored things)

Anyway, dotted/dashed borders did not work with overflow: hidden. The reason why is we use core animation borders in this case which is incorrect as CA cannot do these types of borders. So I added a check to make sure that the borders are solid as well if we want to use CA to draw them.

Differential Revision: D67720492
@joevilches
Copy link
Contributor

Should be fixed in #48414 for new arch which I think you are using? The logs say otherwise but not sure how accurate that is

joevilches added a commit to joevilches/react-native that referenced this issue Dec 30, 2024
…facebook#48414)

Summary:

Was looking into facebook#48078 which was brought to my attention due to my recent refactorings of iOS Views, especially around how overflow: hidden works. This bug was not brought on by my changes but seems to be a lingering Fabric bug (iirc this bool was not changed when I refactored things)

Anyway, dotted/dashed borders did not work with overflow: hidden. The reason why is we use core animation borders in this case which is incorrect as CA cannot do these types of borders. So I added a check to make sure that the borders are solid as well if we want to use CA to draw them.

Changelog: [iOS] [Fixed] - Dashed & dotted borders now work with overflow: hidden

Reviewed By: mdvacca

Differential Revision: D67720492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

6 participants