Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation error #38

Open
lauridskern opened this issue Mar 16, 2023 · 2 comments
Open

Fix deprecation error #38

lauridskern opened this issue Mar 16, 2023 · 2 comments

Comments

@lauridskern
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-keyboard-avoiding-scroll-view@1.0.1 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.

@cparello
Copy link

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
Copy link

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants