react-native-keyboard-avoiding-scroll-view icon indicating copy to clipboard operation
react-native-keyboard-avoiding-scroll-view copied to clipboard

Fix deprecation error

Open lauridskern opened this issue 2 years ago • 3 comments

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.

lauridskern avatar Mar 16 '23 20:03 lauridskern

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

cparello avatar Mar 21 '23 22:03 cparello

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]

cparello avatar Mar 22 '23 18:03 cparello

Made @fivecar/react-native-keyboard-avoiding-scrollview to:

  1. Get rid of the currentlyFocusedField error.
  2. Bring the library up to modern Typescript (e.g. for KeyboardAvoidingFlatList to use types correctly.

fivecar avatar Mar 11 '25 19:03 fivecar