question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On iPhone, on every keystroke input toolbar jumps up and down

See original GitHub issue

Issue Description

On iPhone, for every keystroke input toolbar jumps up and down.

screenshot

I investigated little bit and found that onKeyboardWillShow is called for every keystroke, and it keeps changing bottomOffset by this.setBottomOffset(this.safeAreaSupport(this.props.bottomOffset))

https://github.com/FaridSafi/react-native-gifted-chat/blob/5ba0c245d1a0e647c44a5c00d28a0497faadf6c0/src/GiftedChat.tsx#L622

https://github.com/FaridSafi/react-native-gifted-chat/blob/5ba0c245d1a0e647c44a5c00d28a0497faadf6c0/src/GiftedChat.tsx#L630

https://github.com/FaridSafi/react-native-gifted-chat/blob/036b347e30c1f1520f61ae6b79945fddec0b75b7/src/GiftedChat.tsx#L586

It seems code safeAreaSupport has changed in master (maybe fixes the issue??), but not reflected in the latest version.

Steps to Reproduce / Code Snippets

Type anything on iPhone.

Expected Results

No jumping

Additional Information

  • Nodejs version: v13.13.0
  • React version: v16.14.0
  • React Native version: v0.63.3
  • react-native-gifted-chat version: v0.16.3
  • Platform(s) (iOS, Android, or both?): iOS
  • TypeScript version: 4.0.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

14reactions
vfa-namnkcommented, Jan 6, 2021

Try this:

const insets = useSafeAreaInsets();

// GiftedChat props
bottomOffset={insets.bottom}

with useSafeAreaInsets from react-native-safe-area-context

7reactions
elevivencommented, Nov 1, 2020

I solved it by that way

bottomOffset={(Platform.OS === 'ios' && 33) || null}
Read more comments on GitHub >

github_iconTop Results From Across the Web

My keyboard is in the middle of my screen… - Apple Community
Tap and hold on the keyboard icon. It's in the bottom right corner of the keyboard. Select Dock and the keyboard will attach...
Read more >
iphone - Move my toolbar up or down based on keyboard and ...
iOS 10, 9 all the way down to 5. UIKeyboardDidChangeFrameNotification. Posted immediately after a change in the keyboard's frame.
Read more >
Workspace for iOS / IPad Feature Request - Disable Extended ...
It happens to all iPad Generations, with iOS 15.4.1 and iOS 15.5. ... Up is left, left is down and if we press...
Read more >
Stop the iOS keyboard hiding your sticky or fixed position header
But if it is a toolbar for the input (like a WYSIWYG editor, for example), then it is essential! And if it goes...
Read more >
Keyboard shortcuts in Microsoft Edge
Keyboard shortcuts in Microsoft Edge ; F12. Open Developer Tools ; Esc. Stop loading page; close dialog or pop-up ; Spacebar. Scroll down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found