Skip to content

Commit

Permalink
feat(android): height issue fixed with keyboard avoiding component in…
Browse files Browse the repository at this point in the history
… new architecture (#45928)

Summary:
Fixes this issue: #45880

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [CHANGED] - Replaced `mLastHeight` with `mVisibleViewArea.height()` since mLastHeight value is not getting updated. For `width` we are already using `mVisibleViewArea.width()`

Pull Request resolved: #45928

Test Plan: - Tested the fix in new and old architecture both

Reviewed By: christophpurrer

Differential Revision: D61023998

Pulled By: cortinico

fbshipit-source-id: df67616330effb7b9e6724d94b3be92c0dbd6190
  • Loading branch information
shubhamguptadream11 authored and facebook-github-bot committed Aug 9, 2024
1 parent f2aa3fe commit 603eb94
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ private void checkForKeyboardEvents() {
sendEvent(
"keyboardDidHide",
createKeyboardEventPayload(
PixelUtil.toDIPFromPixel(mLastHeight),
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
0,
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
0));
Expand Down Expand Up @@ -944,7 +944,7 @@ private void checkForKeyboardEventsLegacy() {
sendEvent(
"keyboardDidHide",
createKeyboardEventPayload(
PixelUtil.toDIPFromPixel(mLastHeight),
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
0,
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
0));
Expand Down

0 comments on commit 603eb94

Please sign in to comment.