Skip to content

keyboardVerticalOffset is unreliable as useHeaderHeight produces different measurements for different phones #1356

@romin-backpack

Description

@romin-backpack

Consider these three phones:

iPhone 17 Pro Max
Samsung S25
Xiaomi Redmi Note 13

There's no way to reliably and deterministically Implement KeyboardAvoidingView while using react-navigation. This is because useHeaderHeight is unreliable, sometimes it considers the height of the status bar and sometimes it doesn't. This leads to content being hidden behind the keyboard in some cases, while in other cases it pushes the content up more than necessary.

In some scenarios I'm just adding a component that animates its height when the keyboard shows/hides although this kind of defeats the purpose of this library, as this is quite a common scenario.

Is there a better solution to this or do we have to wait until react navigation measures the height of the top navigation bar and status bar correctly?

Metadata

Metadata

Assignees

Labels

KeyboardAvoidingView 🧪Anything related to KeyboardAvoidingView componentenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions