From a86bba4fb8df0d704956043bba8eb73151659653 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Wed, 17 Jun 2026 19:34:01 +0200 Subject: [PATCH] fix: trigger full event lifecycle when keyboard is syncing on Android --- .../listeners/KeyboardAnimationCallback.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt b/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt index 677d563ccd..dc4e1d0491 100644 --- a/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +++ b/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt @@ -393,8 +393,13 @@ class KeyboardAnimationCallback( "KeyboardController::" + if (!isKeyboardVisible) "keyboardDidHide" else "keyboardDidShow", getEventParams(keyboardHeight), ) - // dispatch `onMove` to update RN animated value and `onEnd` to indicate that transition finished - listOf(KeyboardTransitionEvent.Move, KeyboardTransitionEvent.End).forEach { eventName -> + // dispatch full lifecycle of onStart/onMove/onEnd events to update RN animated value and + // keep imperative hooks like `useKeyboardHandler` in sync + listOf( + KeyboardTransitionEvent.Start, + KeyboardTransitionEvent.Move, + KeyboardTransitionEvent.End, + ).forEach { eventName -> context.dispatchEvent( eventPropagationView.id, KeyboardTransitionEvent(