From 503c3c8d6a13a16d76149213b9eeeed7fe77f8e5 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Tue, 30 Jul 2024 18:04:50 +0200 Subject: [PATCH 1/3] fix: use `KeyboardAvoidingView` from keyboard controller --- src/components/KeyboardAvoidingView/index.ios.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/KeyboardAvoidingView/index.ios.tsx b/src/components/KeyboardAvoidingView/index.ios.tsx index 171210eab7ac..68cfa73e90b5 100644 --- a/src/components/KeyboardAvoidingView/index.ios.tsx +++ b/src/components/KeyboardAvoidingView/index.ios.tsx @@ -2,7 +2,7 @@ * The KeyboardAvoidingView is only used on ios */ import React from 'react'; -import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; +import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native-keyboard-controller'; import type {KeyboardAvoidingViewProps} from './types'; function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) { From 4318d76b600eee39f28346607177893af4c9842f Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Wed, 31 Jul 2024 17:46:55 +0200 Subject: [PATCH 2/3] fix: keyboard-controller incorrect `heightWhenOpened` value --- ...-keyboard-controller+1.12.2+001+initial.patch} | 0 ...roller+1.12.2+001+keyboard-avoiding-view.patch | 15 +++++++++++++++ 2 files changed, 15 insertions(+) rename patches/{react-native-keyboard-controller+1.12.2.patch => react-native-keyboard-controller+1.12.2+001+initial.patch} (100%) create mode 100644 patches/react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch diff --git a/patches/react-native-keyboard-controller+1.12.2.patch b/patches/react-native-keyboard-controller+1.12.2+001+initial.patch similarity index 100% rename from patches/react-native-keyboard-controller+1.12.2.patch rename to patches/react-native-keyboard-controller+1.12.2+001+initial.patch diff --git a/patches/react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch b/patches/react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch new file mode 100644 index 000000000000..3002a50c7986 --- /dev/null +++ b/patches/react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/react-native-keyboard-controller/src/components/KeyboardAvoidingView/hooks.ts b/node_modules/react-native-keyboard-controller/src/components/KeyboardAvoidingView/hooks.ts +index 676eafc..6d84beb 100644 +--- a/node_modules/react-native-keyboard-controller/src/components/KeyboardAvoidingView/hooks.ts ++++ b/node_modules/react-native-keyboard-controller/src/components/KeyboardAvoidingView/hooks.ts +@@ -33,6 +33,10 @@ export const useKeyboardAnimation = () => { + + isClosed.value = e.height === 0; + ++ if (e.height > 0) { ++ heightWhenOpened.value = e.height; ++ } ++ + // `height` update happens in `onMove` handler + // in `onEnd` we need to update only if `onMove` + // wasn't called (i. e. duration === 0) From 473f8b45921baa06cfc4a6722d48fa7d6aa08dc0 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Wed, 31 Jul 2024 17:47:39 +0200 Subject: [PATCH 3/3] chore: rename patch --- ...e-keyboard-controller+1.12.2+002+keyboard-avoiding-view.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patches/{react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch => react-native-keyboard-controller+1.12.2+002+keyboard-avoiding-view.patch} (100%) diff --git a/patches/react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch b/patches/react-native-keyboard-controller+1.12.2+002+keyboard-avoiding-view.patch similarity index 100% rename from patches/react-native-keyboard-controller+1.12.2+001+keyboard-avoiding-view.patch rename to patches/react-native-keyboard-controller+1.12.2+002+keyboard-avoiding-view.patch