Skip to content

[$125] android-status-After selecting emoji, message field shown focused but keypad not shown #61328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 8 tasks
nlemma opened this issue May 2, 2025 · 17 comments
Open
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@nlemma
Copy link

nlemma commented May 2, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: V9.1 30-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: N/a
Email or phone of affected tester (no customers): Slottwo1 [email protected]
Issue reported by: Applause Internal Team
Device used: Redminote note 10s android 13
App Component: User Settings

Action Performed:

  1. Launch app
  2. Tap account - status icon
  3. Select an emoji

Expected Result:

After selecting emoji, message field shown focused so keypad must be shown.

Actual Result:

After selecting emoji, message field shown focused but keypad not shown.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6819575_1746190171165.Screenrecorder-2025-05-02-18-10-00-746.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021918306415997154754
  • Upwork Job ID: 1918306415997154754
  • Last Price Increase: 2025-05-02
  • Automatic offers:
    • allgandalf | Reviewer | 107217478
Issue OwnerCurrent Issue Owner: @yuwenmemon
@nlemma nlemma added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels May 2, 2025
Copy link

melvin-bot bot commented May 2, 2025

Triggered auto assignment to @twisterdotcom (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.

@twisterdotcom
Copy link
Contributor

Yeah, sure. Niche but would be nice to show the keyboard whenever the field is focused of course.

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label May 2, 2025
@melvin-bot melvin-bot bot changed the title android-status-After selecting emoji, message field shown focused but keypad not shown [$250] android-status-After selecting emoji, message field shown focused but keypad not shown May 2, 2025
Copy link

melvin-bot bot commented May 2, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021918306415997154754

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 2, 2025
Copy link

melvin-bot bot commented May 2, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf (External)

@twisterdotcom twisterdotcom changed the title [$250] android-status-After selecting emoji, message field shown focused but keypad not shown [$125] android-status-After selecting emoji, message field shown focused but keypad not shown May 2, 2025
@twisterdotcom twisterdotcom added Weekly KSv2 and removed Daily KSv2 labels May 2, 2025
Copy link

melvin-bot bot commented May 2, 2025

Upwork job price has been updated to $125

@twisterdotcom twisterdotcom moved this to Bugs and Follow Up Issues in #expensify-bugs May 2, 2025
@rohit9625
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

After selecting emoji, message field shown focused but keypad not shown.

What is the root cause of that problem?

Here we are focusing the text input when the Emoji Picker modal hides:

onModalHide={() => {
inputRef.current?.focus();
}}

The root cause is a race condition between the dismissal animation of the modal and the invocation of the focus() method on the TextInput. Since the modal is still animating or affecting the layout when focus() is called, the input is not yet considered ready to receive keyboard focus by the system.

What changes do you think we should make in order to solve the problem?

We should delay the .focus() call until after the modal has fully closed by using setTimeout with a slight delay (e.g. 150ms), or use InteractionManager.runAfterInteractions() to ensure the UI is idle before focusing the input.

  onModalHide={() => {
      setTimeout(() => {
          inputRef.current?.focus();
      }, 150);
  }}

Results

After_Keyboard_Fix.mp4

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None, it's a timing issue in the UI

What alternative solutions did you explore? (Optional)

None :(

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.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 2, 2025
@bernhardoj
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

The keyboard doesn't show after the emoji picker is closed.

What is the root cause of that problem?

We immediately focus on the input when the modal hides,

onModalHide={() => {
inputRef.current?.focus();
}}

but it's a known issue on Android that modal hide callback is called too early, which is why most of the time, we delay the focus.

What changes do you think we should make in order to solve the problem?

We can use isWindowReadyToFocus (this is android only util) to make sure it's ready to focus.

isWindowReadyToFocus().then(() => inputRef.current?.focus());

or

We can use focusComposerWithDelay.

focusComposerWithDelay(inputRef.current)(true)

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

@PiyushChandra17
Copy link

PiyushChandra17 commented May 2, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-05-02 21:53:04 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

android-status-After selecting emoji, message field shown focused but keypad not shown

What is the root cause of that problem?

Once the emoji picker modal closes, it calls the inputRef.current?.focus() which makes the input field focused which is the correct behaviour but on Android may skip showing the keyboard if this happens too early

onModalHide={() => {
inputRef.current?.focus();
}}

What changes do you think we should make in order to solve the problem?

We should make use of InteractionManager + setTimeout in order to delay inside the onModalHide to make sure Android has enough time to settle before focusing the input.

Update this line:

onModalHide={() => {
inputRef.current?.focus();
}}

with,

onModalHide={() => {
    InteractionManager.runAfterInteractions(() => {
        setTimeout(() => {
            inputRef.current?.focus();
        }, 50); 
    });
}}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

Result

Image

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.

Copy link
Contributor

github-actions bot commented May 2, 2025

⚠️ @PiyushChandra17 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

Copy link

melvin-bot bot commented May 6, 2025

@allgandalf Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label May 6, 2025
@allgandalf
Copy link
Contributor

Looking today!

@melvin-bot melvin-bot bot removed the Overdue label May 6, 2025
@allgandalf
Copy link
Contributor

Solution from @bernhardoj makes the most sense to me, lets go with their proposal.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 7, 2025

Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@bernhardoj
Copy link
Contributor

PR is ready

cc: @allgandalf

Copy link

melvin-bot bot commented May 13, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@allgandalf
Copy link
Contributor

^ false flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

7 participants