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

fillOpacity not working with fill="currentColor" #1802

Closed
robrechtme opened this issue Jul 15, 2022 · 2 comments
Closed

fillOpacity not working with fill="currentColor" #1802

robrechtme opened this issue Jul 15, 2022 · 2 comments

Comments

@robrechtme
Copy link

robrechtme commented Jul 15, 2022

Bug

Using fillOpacity in combination with fill="currentColor" does not work on iOS and Android. On web it shows expected behaviour.

<Svg width="56" height="56" viewBox="0 0 56 56" color="red">

  {/* ✅ Works: renders at 20% opacity */}
  <Rect x="25" y="25" width="20" height="20" rx="4" fill="red" fillOpacity="0.2" />

  {/* ❌ Expected: renders at 20% opacity; Actual: renders at full opacity */}
  <Rect width="20" height="20" rx="4" fill="currentColor" fillOpacity="0.2" />

  {/* ✅ Works: renders at zero opacity */}
  <Rect width="20" height="20" rx="4" fill="currentColor" fillOpacity="0" />
 </Svg>

Environment info

Expo 45 (RN 0.68.2), same on RN bare 0.68.2
Library version: 12.3.0

Short, Self Contained, Correct (Compilable), Example

https://snack.expo.dev/@robrechtme/bug-react-native-svg-currentcolor

@robrechtme
Copy link
Author

robrechtme commented Jul 15, 2022

Same for opacity and strokeOpacity, they have no effect on iOS and Android when combined with fill="currentColor"/stroke="currentColor"

@robrechtme
Copy link
Author

Duplicate of #1345.

@robrechtme robrechtme closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant