Open oliviercperrier opened 2 months ago
Hey @oliviercperrier!
I would able to reproduce the issue that you described but I can see it is not related to react-native-reanimated
. When you remove the animated style and use transform
with translateY
or translateX
inside the non-animated component style, you will see the same problem.
It is pretty interesting why it stops working after adding translation.
It you want to easily fix that, you can add/move the border radius prop from the Pressable
to its child component.
Hey @oliviercperrier!
I would able to reproduce the issue that you described but I can see it is not related to
react-native-reanimated
. When you remove the animated style and usetransform
withtranslateY
ortranslateX
inside the non-animated component style, you will see the same problem.It is pretty interesting why it stops working after adding translation.
It you want to easily fix that, you can add/move the border radius prop from the
Pressable
to its child component.
Thanks @MatiPl01. Thats what i did in the meantime. Ill be interested to know what the root cause if you find something.
Initial comment was wrong
It is a React Native issue, the Animated
API from RN behaves exactly the same in combination with overflow: hidden
.
Description
(The issue is only on mobile browser chrome/safari/firefox)
This issue is very weird but ill try to explain it:
I have a Button component thats using an animatedStyle. The button base style contains
overflow:hidden
and some border radius.There is also a
absolute
positioned purple view inside the button so we can see when the overflow is working and when its not.When its working properly, we can see the border radius on the Buttons, when its not, the Buttons have no border radius.
When i put this Button component in a parent View that contains other components so that the height of this View is pretty large, the overflow hidden stops working/become visible for all buttons.
Here is a video:
https://github.com/user-attachments/assets/2d334970-a9ed-4fa0-a781-0cdad87bf3c7
You can see that in the first part of the video there's nothing under the buttons so the parent view is not very tall. At 6sec, im adding some Text components to make the parent View height bigger and you can see the buttons overflow are not hidden anymore (we see the purple box overflowing the Button container).
When i remove the
animatedStyle
from the Button component. Everything is working fine.Steps to reproduce
app.tsx -> index.tsx
Snack or a link to a repository
https://github.com/oliviercperrier/repro-reanimated-overflow
Reanimated version
3.10.1
React Native version
0.74.5
Platforms
Web
JavaScript runtime
None
Workflow
React Native
Architecture
None
Build type
None
Device
Real device
Device model
Iphone 15
Acknowledgements
Yes