-
-
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
Animated keyboard events #1432
Comments
I don't really understand how you want to use shared values to handle keyboard events. Could you describe your use case more clearly and fill all template sections? |
something like gesture handler events for example const anim = useSharedValue(0)
useAnimatedKeyboard({
didShow(event){
anim.value = withTiming(event.height)
}
didHide(_){
anim.value = withTiming(0)
}
}) |
I'll discuss this feature internally with the team but I'm not convinced about this feature. We want to focus on animations and listening to keyboard events isn't directly related to that. |
There are a few problems with that. First, we currently don't have any way to listen to non-direct events (that aren't connected to Views, keyboard event is a non-direct event). This feature is more related to generic event listening and not animations so we won't include it in this form in Reanimated. We may consider adding this as a part of some other API in the future but for now, we don't want to make API more complex than it is today. |
It would be great if we can animate with the keyboard. Currently, the only way to do that is to animated by ourselves, but the animation timing and curve are slightly different than the keyboard. |
Description
A few months ago I made a PR to hooks repo, but after discussing we found that we need something native for the keyboard events
react-native-community/hooks#205
I imagine something like a shared value that subscribed as a keyboard event on the native side. or a hook is like useAnimatedStyle.
Caveats
Motivation
Code example
The text was updated successfully, but these errors were encountered: