Skip to content
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

Flush animation-frame and immediates on keyboard event to follow same flow as other types of events #4098

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

kmagiera
Copy link
Member

Summary

This diff fixes an issue with animated views not updating when animating along keyboard. This problem regressed after #3970 where we changed the logic of when enqueued callbacks for animation frame and immediates are flushed. The logic has been moved from c++ to js and we added some code to execute animation frame and immediates as a part of event handling process. However, keyboard events have a separate flow of providing event data (we should unify this at some point), and we missed updating it in that place.

This PR adds similar logic to what we use for regular events into the code responsible for handling keyboard events.

Test plan

Run animated keyboard example on iOS and Android.

@kmagiera kmagiera added this pull request to the merge queue Feb 24, 2023
Merged via the queue into main with commit 2fd0da8 Feb 24, 2023
@kmagiera kmagiera deleted the fix-setimmediate-after-keyboard-event branch February 24, 2023 13:11
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
… flow as other types of events (software-mansion#4098)

## Summary

This diff fixes an issue with animated views not updating when animating
along keyboard. This problem regressed after software-mansion#3970 where we changed the
logic of when enqueued callbacks for animation frame and immediates are
flushed. The logic has been moved from c++ to js and we added some code
to execute animation frame and immediates as a part of event handling
process. However, keyboard events have a separate flow of providing
event data (we should unify this at some point), and we missed updating
it in that place.

This PR adds similar logic to [what we use for regular
events](https://github.com/software-mansion/react-native-reanimated/blob/535b5d64c0720da3a9a39d99a67e878fe09b5154/src/reanimated2/core.ts#L117)
into the code responsible for handling keyboard events.

## Test plan

Run animated keyboard example on iOS and Android.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants