-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Crashes during CSS transitions of complex properties #6966
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MatiPl01
force-pushed
the
@matipl01/css-transition-crashes-fix
branch
from
January 31, 2025 15:30
b247abf
to
a37bff4
Compare
MatiPl01
commented
Jan 31, 2025
...ve-reanimated/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp
Show resolved
Hide resolved
MatiPl01
commented
Jan 31, 2025
...e-reanimated/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp
Show resolved
Hide resolved
MatiPl01
changed the title
[WIP] fix: Crashes during transitions of some CSS properties
fix: Crashes during transitions of some CSS properties
Jan 31, 2025
MatiPl01
changed the title
fix: Crashes during transitions of some CSS properties
fix: Crashes during CSS transitions of complex properties
Jan 31, 2025
I can also see that during the first transition view flickers. I think it is related to a well known |
piaskowyk
approved these changes
Feb 4, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There were a few different issues related to
boxShadow
interpolation in CSS transitions (and to other non-primitive props except transforms, where I had a special case handling logic implemented).List of changes
getChangedProps
- it handled arrays in the same way as objects, which resulted in creating objects with indexes as keys instead of arrays,getChangedProps
implementation,updateKeyframesFromStyleChange
method implementation used by CSS transitions, which didn't support arrays of different lengths / objects with different keys, where keys of the old object not existing in the new one were ignored,boxShadow
string parsing functionparseBoxShadowString
and added tests to this function to make sure it works as expected,Examples
boxShadow
exampleSource code
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-31.at.21.18.59.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-31.at.21.01.51.mp4
Separate props shadow example
Source code
You can see that in the second example shadow is smoothly animated in both axes, whilst, in the first example, animation is smooth only in y axis. This happens because the
width
property is missing in one ofshadowOffset
values and previous implementation didn't support this case.Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-31.at.21.19.22.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-31.at.21.02.29.mp4