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

Keyboard space is not removing insets from the ScrollView correctly #2042

Open
douglasjunior opened this issue May 3, 2024 · 1 comment
Open

Comments

@douglasjunior
Copy link
Contributor

douglasjunior commented May 3, 2024

Describe the bug

Hi @hackiftekhar, Douglas here again, the maintainer of React Native Keyboard Manager.

Recently I have updated the IQKeyboardManager from 6 to 7.0.2, and we can note several improvements and fixes in the library (including #1361 and #1422), thank you very much for that!

But also I found a new situation related to ScrollView in React Native, when using in a React Navigation screen.

To Reproduce

I dont know if you can run a React Native project, but to reproduce just run the Sample project branch 7-preview of the React Native Keyboard Manager.

  1. Clone the repo
  2. cd Sample
  3. ./install.sh
  4. And go!

Expected behavior

We expect that the extra bottom space to be removed when keyboard closes.

Screenshots

Version 7.0.2

keyboard manager

Version 6.5.16

keyboard manager version 6

Demo Project

Versions

Xcode: 15.2
Mac OS: 13.5.1
Simulator/Device: Simulator
Simulator/Device Name: iPhone 15 Pro Max - iOS 17.2
Library Version: 7.0.2

Additional context

Looking to the log, seems that the insets are set wrong when the keyboard closes, I think that the bottom should be set to 0.0 instead of 420.0:

IQKeyboardManager| | old ContentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 376.0, right: 0.0) new ContentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 420.0, right: 0.0)

Debug log:

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:]  perform input operation requires a valid sessionID
IQKeyboardManager|	>>>>> restorePosition() started >>>>>
IQKeyboardManager|	|	Restoring contentInset to: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0)
IQKeyboardManager|	<<<<< restorePosition() ended: 0.002194624999901862 seconds <<<<<
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:]  perform input operation requires a valid sessionID
IQKeyboardManager|	>>>>> addToolbarIfRequired() started >>>>>
IQKeyboardManager|	|	Found 20 responder sibling(s)
IQKeyboardManager|	<<<<< addToolbarIfRequired() ended: 0.01065550000021176 seconds <<<<<
IQKeyboardManager|	>>>>> adjustPosition() started >>>>>
IQKeyboardManager|	|	Need to move: -327.0, will be moving down
IQKeyboardManager|	|	Saving ScrollView New contentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0)
and contentOffset: (0.0, 0.0)
IQKeyboardManager|	|	old ContentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0) new ContentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 376.0, right: 0.0)
IQKeyboardManager|	<<<<< adjustPosition() ended: 0.0005828333341924008 seconds <<<<<
IQKeyboardManager|	>>>>> addToolbarIfRequired() started >>>>>
IQKeyboardManager|	|	Found 20 responder sibling(s)
IQKeyboardManager|	<<<<< addToolbarIfRequired() ended: 0.00037524999970628414 seconds <<<<<
IQKeyboardManager|	>>>>> adjustPosition() started >>>>>
IQKeyboardManager|	|	Need to move: -283.0, will be moving down
IQKeyboardManager|	|	old ContentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 376.0, right: 0.0) new ContentInset: UIEdgeInsets(top: 0.0, left: 0.0, bottom: 420.0, right: 0.0)
IQKeyboardManager|	<<<<< adjustPosition() ended: 0.0003427083320275415 seconds <<<<<

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:]  perform input operation requires a valid sessionID
@douglasjunior
Copy link
Contributor Author

douglasjunior commented May 3, 2024

Just to add more information about my debug, If I force the ignoreContentInsetAdjustment prop to true, then the ScrollView bottom space disappears after keyboard closes and the user scroll the screen.

image

keyboard manager 2

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

1 participant