question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blur not applied unless opacity is at 1

See original GitHub issue

I’m currently using 1.2.0 and RN 0.37.0, and running ios 10.1 in the simulator. I noticed this first when I was attempting to run a transition, where I animated the opacity of a View that contains the BlurView and the blur just appeared when the transition was complete. In investigating, I found that it wasn’t just the animation, it was that any opacity < 1 on the blur or its parent would prevent it from blurring.

For example, this shows a blur:

<View style={{flexDirection: 'row'}}>
  <Image
    resizeMode="contain"
    source={{uri: 'https://placekitten.com/108/120'}}
    style={{width: 120, height: 108}} />
  <View style={{opacity: 1, position: 'absolute', left: 0, right: 0, top: 0, bottom: 0}}>
    <BlurView blurType="light" blurAmount={50} style={{flexGrow: 1}} />
  </View>
</View>

But the blur completely disapears when I change the inner View to:

<View style={{opacity: 0.9, position: 'absolute', left: 0, right: 0, top: 0, bottom: 0}}>
  <BlurView blurType="light" blurAmount={50} style={{flexGrow: 1}} />
</View>

Notice the only difference is the opacity on the container of the second one. I tried moving the absolute positioning off of the containing View and that didn’t help either.

This seems important, as as far as I can tell the recommended way to animate a blur view is to animate its container’s opacity, so if that’s not working, there’s no way to animate it.

Please let me know if there’s any other information I can provide.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
getreupcommented, Nov 29, 2016

hey @liamfd

I’ve been struggling hard with this. It’s not actually an issue with this library, but an issue with iOS itself. The way I fixed it is that I had to make sure the BlurView was not position:absolute.

So, if you need to blur things, make them absolute and behind the blurview, like this:

return (
<View style={{positon:'absolute', top:0, left:0, right:0, bottom:0>
  <Image
          style={{position:'absolute', left:0, right:0, top:0, bottom:0}}
          source={{uri: splashImageURI}}
        />
  <BlurView style={{flex:1, alignSelf:'stretch'}} />
</View>
)

Hopefully that helps.

0reactions
Kureevcommented, Jan 6, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Blur not applied unless opacity is at 1 · Issue #126 - GitHub
I'm currently using 1.2.0 and RN 0.37.0, and running ios 10.1 in the simulator. I noticed this first when I was attempting to...
Read more >
Why isn't backdrop-filter: blur() working properly?
As you can see, although the div has the right color/opacity, it is not blurring the part of the image it covers. If...
Read more >
Blur filter + opacity behind drop down menu not working
Currently, the sub-menu is not blurred. If I blur the sub-menu, it changes the color altogether: So, my expected result is: submenu background ......
Read more >
backdrop-filter - CSS: Cascading Style Sheets - MDN Web Docs
The backdrop-filter CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it...
Read more >
backdrop-filter | CSS-Tricks
The backdrop-filter property in CSS is used to apply filter effects ( grayscale , contrast , blur , etc) to the background/backdrop of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found