Children position does not animate when animating view's width using Layout Animations #6280
Labels
Area: Layout Animations
Platform: iOS
This issue is specific to iOS
Repro provided
A reproduction with a snippet of code, snack or repo is provided
Description
When a view's width is animated using Layout Animations(entry, exit, layout transitions), children views position do not update for the intermediate states but instead jump to the final state.
example code(available in branch main of linked repo):
Check the video here. I have a button that toggles between rendering 1 view and 2 views. Both views have their widths animated using Entry/Exit or Layout Transition, but the problem is that the position of the text inside them does not animate with the view.
The resetted border radius seems to be another bug
Simulator.Screen.Recording.-.iPhone.15.-.2024-07-16.at.20.23.44.mp4
However if the view's width was animated from within useAnimatedStyle, it works(available in branch feat/works):
Simulator.Screen.Recording.-.iPhone.15.-.2024-07-16.at.20.31.35.mp4
I expect the first code to behave like the second one but it doesnt. I prefer to write code as in the first example as it is more declarative and I dont need to set a specific width to the view and instead just have it adapt
Steps to reproduce
Snack or a link to a repository
https://github.com/itsramiel/Animating-Views/tree/main
Reanimated version
3.10.1
React Native version
0.74.3
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo Go
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: