Can't change mainOverlay opacity in tweenHandler
See original GitHub issueI want the main content to go dark when the drawer is open by setting the mainOverlay background to black and opacity to 0 and in tweenHandler tried to change the opacity but it doesn’t seem to work:
<Drawer
ref="navigation"
type="displace"
content={<SideMenu />}
tapToClose={true}
openDrawerOffset={0.2}
panCloseMask={0.2}
styles={{mainOverlay: {backgroundColor: '#000000', opacity: 0}}}
negotiatePan={true}
tweenHandler={(ratio) => ({
mainOverlay: { opacity: ( ratio / 2 )}
})}
>
Is this a bug or am I doing it wrong?
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Make a mainOverlay customizable thru the tweenHandler #113
I have a case where I need to change a color of the overlay, but currently I can change a background color of...
Read more >Can't change overlay color and opacity in fancybox 2.1.4
I edited the overlay parameters in the helper file that was included in demo.html but I can't get it to work. I've looked...
Read more >Background Overlay Opacity Issues - WordPress.org
Why is it so painfully impossible to remove the background overlay?! CSS does not help. Server cache has been cleared multiple times. body...
Read more >Layer opacity and blending modes in Adobe Photoshop
Learn how to use layer opacity and blending modes in Adobe Photoshop ... such as Inner Glow or Color Overlay, without changing layer...
Read more >Background Image Overlay Opacity in Squarespace 7.1 ...
In this tutorial, I'm going to walk you through changing the background overlay opacity of a section. Here is the exact code I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Don’t know if anyone is still needing help, but I figured out how to make the area behind the drawer go darker with opacity.
tweenHandler={(ratio) => ({ mainOverlay:{ backgroundColor:"rgba(71, 71, 71,"+ (ratio)/1.5+")"}, })}
I just used rgba (which is supported by react native. Runs on both iOS and Android) and used the ratio to control the opacity. Hope that helps! @rt2zz @Qizly
@garrettbland Thank you very much 😃