Skip to content

Commit

Permalink
Merge pull request #46513 from margelo/fix/44514-kav-from-keyboard-co…
Browse files Browse the repository at this point in the history
…ntroller

fix: use `KeyboardAvoidingView` from keyboard controller
  • Loading branch information
marcochavezf authored Aug 1, 2024
2 parents c46990b + 473f8b4 commit 73f97c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion src/components/KeyboardAvoidingView/index.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 73f97c9

Please sign in to comment.