Fix deprecation error
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-keyboard-avoiding-scroll-view/dist/KeyboardAvoidingContainer.js b/node_modules/react-native-keyboard-avoiding-scroll-view/dist/KeyboardAvoidingContainer.js
index fadc258..a72fd7d 100644
--- a/node_modules/react-native-keyboard-avoiding-scroll-view/dist/KeyboardAvoidingContainer.js
+++ b/node_modules/react-native-keyboard-avoiding-scroll-view/dist/KeyboardAvoidingContainer.js
@@ -111,7 +111,7 @@ export function useKeyboardAvoidingContainerProps({ stickyFooter, containerStyle
if (keyboardLayoutRef.current)
return;
const { endCoordinates: newKeyboardLayout } = event;
- const newFocusedTextInputNodeHandle = NativeTextInput.State.currentlyFocusedField();
+ const newFocusedTextInputNodeHandle = NativeTextInput.State.currentlyFocusedInput();
const newStickyFooterNodeHandle = findNodeHandle(stickyFooterRef.current);
const [newFocusedTextInputLayout, newStickyFooterLayout,] = await Promise.all([
newFocusedTextInputNodeHandle
This issue body was partially generated by patch-package.
thanks, i was looking for a fork @lauridskern
I wish there was a way to make this always scroll the last input right to the keyboard, or even choose the element that should be right above the keyboard. if i have 4 inputs it scrolls up to far and only 2 can be scene
I started getting this error on ios after i patched it
WARN Possible Unhandled Promise Rejection (id: 0): Error: Exception in HostFunction: Malformed calls from JS: field sizes are different. [[35,58],[12,0],[[59,100,1679509378697,false]],585]
Made @fivecar/react-native-keyboard-avoiding-scrollview to:
- Get rid of the
currentlyFocusedFielderror. - Bring the library up to modern Typescript (e.g. for
KeyboardAvoidingFlatListto use types correctly.