You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-01-23] [$250] Android - Chat - UI gap shown under emoji picker grid with keyboard #78810
Please re-state the problem that we are trying to solve in this issue.
A blank space appears at the bottom of the emoji grid when the keyboard is opened, and the emoji grid is aligned to the top
What is the root cause of that problem?
The position of the EmojiPicker is calculated based on the anchor position of the EmojiPickerButton that we click to open the EmojiPicker. However, when the keyboard is already visible, i.e., the composer is focused, and we press the EmojiPickerButton, then the calculation of the position of EmojiPicker happens before the keyboard is completely hidden.
That's why the anchor position of EmojiPickerButton passed here could be in the middle of the transition to the bottom:
Hence, the EmojiPicker's calculated popover position can be slightly above sometimes, and it also varies device to device(due to how fast the keyboard hides on different devices). So, if the keyboard takes more time to hide, then the popover can be placed at the top of the screen because the initial anchor position of EmojiPickerButton is at the middle of the screen when the keyboard is visible.
Note: It doesn't happen when the composer is not already focused when pressing the EmojiPickerButton.
Screen.Recording.2026-01-04.at.11.40.21.AM.mov
However, we do have logic to dismiss the keyboard before calculating the anchor position for EmojiPicker:
And, the keyboardDidHide event triggers as soon as the Keyboard.dismiss() function is called, i.e., before the keyboard is completely hidden. However, the keyboardDidHide event should be triggered only after the keyboard is completely hidden, similar to iOS. Notice the logs timing on the iOS and Android:
Screen.Recording.2026-01-04.at.12.07.42.PM.mov
Hence, the issue is reproducible for Android devices only.
What changes do you think we should make in order to solve the problem?
We had a similar issue(#70692) in the past where the EmojiPicker was shown at the top of the StatusPage. That's why the dismissKeyboardAndExecute function was created in PR(#71323). This function uses KeyboardEvents from react-native-keyboard-controller for Android(index.android.ts) and resolves immediately for iOS(index.ts) because issue not reproducible for iOS:
// For iOS and other platforms, execute callback immediately
cb();
resolve();
});
};
So, we can simply update the code at the EmojiPickerButton to dismiss the keyboard using the dismissKeyboardAndExecute function before calling showEmojiPicker, similar to EmojiPickerButtonDropdown:
Note: There's still some flickering in the EmojiPicker popover when opening it. It seems like a different issue as it also happens for the EmojiPickerButtonDropdown at the StatusPage. This is some rendering issue and should be handled separately because fixing this won't fix the UI gap issue, and vice versa.
What alternative solutions did you explore? (Optional)
Alternatively, we can update the dismiss function at here:
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Android - Chat - UI gap shown under emoji picker grid with keyboard[/-][+][$250] Android - Chat - UI gap shown under emoji picker grid with keyboard[/+]on Jan 7, 2026
Please re-state the problem that we are trying to solve in this issue:
A blank space appears at the bottom of the emoji grid on Android when the keyboard is opened, and the emoji grid is aligned to the top instead of sitting flush above the keyboard.
What is the root cause of that problem:
The position of the EmojiPicker is calculated based on the anchor position of the EmojiPickerButton at the time of opening. If the keyboard is already visible, the composer hasn’t settled to its final position yet, causing the popover to be misaligned and leave a blank space at the bottom.
What changes do you think we should make in order to solve the problem:
Remeasure the emoji anchor once the keyboard is fully hidden using the existing keyboard state context. This ensures the popover recalculates its position after the composer snaps back down, eliminating the blank space without modifying Onyx/navigation flows or adding timing hacks.
Code changes to src/components/EmojiPicker/EmojiPicker.tsx:
The emoji picker now waits for the keyboard to finish hiding (via KeyboardStateProvider) before recalculating its anchor. This ensures the popover aligns correctly with the composer’s final position, removing the bottom gap while keeping existing focus/refocus and modal behavior intact.
What alternative solutions did you explore? (Optional)
N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jan 3, 2026
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.rohit9625 commentedon Jan 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A blank space appears at the bottom of the emoji grid when the keyboard is opened, and the emoji grid is aligned to the top
What is the root cause of that problem?
The position of the
EmojiPickeris calculated based on the anchor position of theEmojiPickerButtonthat we click to open theEmojiPicker. However, when the keyboard is already visible, i.e., the composer is focused, and we press theEmojiPickerButton, then the calculation of the position ofEmojiPickerhappens before the keyboard is completely hidden.That's why the anchor position of
EmojiPickerButtonpassed here could be in the middle of the transition to the bottom:App/src/components/EmojiPicker/EmojiPickerButton.tsx
Lines 54 to 64 in f7265ef
Hence, the
EmojiPicker's calculated popover position can be slightly above sometimes, and it also varies device to device(due to how fast the keyboard hides on different devices). So, if the keyboard takes more time to hide, then the popover can be placed at the top of the screen because the initial anchor position ofEmojiPickerButtonis at the middle of the screen when the keyboard is visible.Screen.Recording.2026-01-04.at.11.40.21.AM.mov
However, we do have logic to dismiss the keyboard before calculating the anchor position for
EmojiPicker:App/src/components/EmojiPicker/EmojiPicker.tsx
Lines 120 to 123 in f7265ef
But it doesn't work reliably on Android because the
dismissfunction relies on thekeyboardDidHideevent fromreact-native:App/src/utils/keyboard/index.android.ts
Lines 24 to 39 in f7265ef
And, the
keyboardDidHideevent triggers as soon as theKeyboard.dismiss()function is called, i.e., before the keyboard is completely hidden. However, thekeyboardDidHideevent should be triggered only after the keyboard is completely hidden, similar to iOS. Notice the logs timing on the iOS and Android:Screen.Recording.2026-01-04.at.12.07.42.PM.mov
Hence, the issue is reproducible for Android devices only.
What changes do you think we should make in order to solve the problem?
We had a similar issue(#70692) in the past where the
EmojiPickerwas shown at the top of theStatusPage. That's why thedismissKeyboardAndExecutefunction was created in PR(#71323). This function usesKeyboardEventsfromreact-native-keyboard-controllerfor Android(index.android.ts) and resolves immediately for iOS(index.ts) because issue not reproducible for iOS:App/src/utils/keyboard/index.android.ts
Lines 41 to 60 in f7265ef
App/src/utils/keyboard/index.ts
Lines 40 to 46 in f7265ef
So, we can simply update the code at the EmojiPickerButton to dismiss the keyboard using the
dismissKeyboardAndExecutefunction before callingshowEmojiPicker, similar toEmojiPickerButtonDropdown:App/src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx
Lines 53 to 55 in f7265ef
Results:
Screen.Recording.2026-01-04.at.12.32.11.PM.mov
Note: There's still some flickering in the
EmojiPickerpopover when opening it. It seems like a different issue as it also happens for theEmojiPickerButtonDropdownat theStatusPage. This is some rendering issue and should be handled separately because fixing this won't fix the UI gap issue, and vice versa.What alternative solutions did you explore? (Optional)
Alternatively, we can update the
dismissfunction at here:App/src/utils/keyboard/index.android.ts
Lines 24 to 39 in f7265ef
To use the
KeyboardEventsfromreact-native-keyboard-controllerinstead of thereact-native's event:Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Android - Chat - UI gap shown under emoji picker grid with keyboard[/-][+][$250] Android - Chat - UI gap shown under emoji picker grid with keyboard[/+]melvin-bot commentedon Jan 7, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022008699842219343211
melvin-bot commentedon Jan 7, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)twinkle-react commentedon Jan 7, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue:
A blank space appears at the bottom of the emoji grid on Android when the keyboard is opened, and the emoji grid is aligned to the top instead of sitting flush above the keyboard.
What is the root cause of that problem:
The position of the
EmojiPickeris calculated based on the anchor position of theEmojiPickerButtonat the time of opening. If the keyboard is already visible, the composer hasn’t settled to its final position yet, causing the popover to be misaligned and leave a blank space at the bottom.What changes do you think we should make in order to solve the problem:
Remeasure the emoji anchor once the keyboard is fully hidden using the existing keyboard state context. This ensures the popover recalculates its position after the composer snaps back down, eliminating the blank space without modifying Onyx/navigation flows or adding timing hacks.
Code changes to
src/components/EmojiPicker/EmojiPicker.tsx:The emoji picker now waits for the keyboard to finish hiding (via
KeyboardStateProvider) before recalculating its anchor. This ensures the popover aligns correctly with the composer’s final position, removing the bottom gap while keeping existing focus/refocus and modal behavior intact.What alternative solutions did you explore? (Optional)
N/A
23 remaining items
rohit9625 commentedon Jan 26, 2026
Friendly bump! @johncschuster :)
johncschuster commentedon Jan 27, 2026
I'm on this now!
johncschuster commentedon Jan 27, 2026
Payment Summary
Contributor: @rohit9625 paid $250 via Upwork ✅
Contributor+: @shubham1206agra due $250 via NewDot
johncschuster commentedon Jan 27, 2026
@shubham1206agra, can you complete the BZ checklist above and then request payment? Thank you!
shubham1206agra commentedon Jan 30, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/66853/changes#r2746402014
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/594841
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-44a8-aaea-a13a-81b375f65e24johncschuster commentedon Jan 30, 2026
@shubham1206agra thanks! Please request payment from NewExpensify! (Payment Summary)
garrettmknight commentedon Apr 2, 2026
$250 approved for @shubham1206agra