You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I put contained Button in Modal and close Modal.
button will have delay shadow when close, cause weird black border.
It seems like elevation in Surface causing this error.
Expected behaviour
only contained button has this delay shadow when modal closed.
it should not have this shadow like text Button and outlined Button.
How to reproduce?
just a simple modal & button code.
exportdefaultfunctionModalTest(){const[isVisible,setIsVisible]=useState(false);return(<><View><Buttonmode="contained"onPress={()=>setIsVisible(true)}>
open
</Button></View><Modalvisible={isVisible}onDismiss={()=>setIsVisible(false)}><Viewstyle={{padding: 20,backgroundColor: 'white',gap: 10,}}><Buttonmode="contained"onPress={()=>setIsVisible(false)}>
contained button
</Button><Buttonmode="text"onPress={()=>setIsVisible(false)}>
text button
</Button><Buttonmode="outlined"onPress={()=>setIsVisible(false)}>
outlined button
</Button></View></Modal></>);}
Preview
2025-08-07.1.55.14.mov
What have you tried so far?
Surface and elevation
it seems like is elevation on surface cause this shadow.
so Surface with elevation and Button in contained mode(MD2) and Button in elevated mode(MD3)
all have same problem.
but I don't know how to fix it.
prevent render Modal when isVisible false
exportdefaultfunctionModalTest(){const[isVisible,setIsVisible]=useState(false);return(<><View><Buttonmode="contained"onPress={()=>setIsVisible(true)}>
open
</Button></View>{isVisible&&(<Modalvisible={isVisible}onDismiss={()=>setIsVisible(false)}><Surfaceelevation={4}style={{padding: 20,backgroundColor: 'white',gap: 10,}}><Buttonmode="contained"onPress={()=>setIsVisible(false)}>
contained button
</Button><Buttonmode="text"onPress={()=>setIsVisible(false)}>
text button
</Button><Buttonmode="outlined"onPress={()=>setIsVisible(false)}>
outlined button
</Button></Surface></Modal>)}</>);}
this will work for sure. for now this is my solution.
but it will not have the fade out effect.
Current behaviour
when I put contained Button in Modal and close Modal.
button will have delay shadow when close, cause weird black border.
It seems like elevation in Surface causing this error.
Expected behaviour
only contained button has this delay shadow when modal closed.
it should not have this shadow like text Button and outlined Button.
How to reproduce?
just a simple modal & button code.
Preview
2025-08-07.1.55.14.mov
What have you tried so far?
Surface and elevation
it seems like is elevation on surface cause this shadow.
so Surface with elevation and Button in contained mode(MD2) and Button in elevated mode(MD3)
all have same problem.
but I don't know how to fix it.
prevent render Modal when isVisible false
this will work for sure. for now this is my solution.
but it will not have the fade out effect.
Your Environment