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 blakef committed Aug 19, 2024
1 parent 196399b commit 1cea8e8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ private void checkForKeyboardEvents() {
sendEvent(
"keyboardDidHide",
createKeyboardEventPayload(
PixelUtil.toDIPFromPixel(mLastHeight),
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
0,
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
0));
Expand Down Expand Up @@ -940,7 +940,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 1cea8e8

Please sign in to comment.