Skip to content
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

[$250] mWeb - Workspace - Input is not auto-focused and keyboard doesn't open when creating a tag #53208

Open
1 of 8 tasks
IuliiaHerets opened this issue Nov 27, 2024 · 44 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 27, 2024

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: 9.0.67-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Login to new dot with an account
  2. Create a new workspace
  3. Go to more features > Tags > Enable tags
  4. Navigate to tags page > Add tag

Expected Result:

Tag creation page is opened, the name input is automatically focused and keyboard is opened

Actual Result:

The name input isn't automatically focused and the keyboard is not opened.
Sometimes the focus and the keyboard appear with a delay

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6677791_1732697567850.video_2024-11-27_11-48-07.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863569158386608990
  • Upwork Job ID: 1863569158386608990
  • Last Price Increase: 2024-12-09
Issue OwnerCurrent Issue Owner: @MonilBhavsar
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

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

@Themoonalsofall
Copy link
Contributor

Themoonalsofall commented Nov 27, 2024

Proposal

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

mWeb - Workspace - Input is not auto-focused and keyboard doesn't open when creating a tag

What is the root cause of that problem?

We are missing autoFocus props in this input

<InputWrapper
InputComponent={TextInput}
maxLength={CONST.TAG_NAME_LIMIT}
label={translate('common.name')}
accessibilityLabel={translate('common.name')}
inputID={INPUT_IDS.TAG_NAME}
role={CONST.ROLE.PRESENTATION}
ref={inputCallbackRef}
/>

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

Add autoFocus to this input

What alternative solutions did you explore? (Optional)

@Shahidullah-Muffakir
Copy link
Contributor

Proposal

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

When user opens the Tags creating page, the input is not focused and the keyboard is not opened.

What is the root cause of that problem?

<InputWrapper
InputComponent={TextInput}
maxLength={CONST.TAG_NAME_LIMIT}
label={translate('common.name')}
accessibilityLabel={translate('common.name')}
inputID={INPUT_IDS.TAG_NAME}
role={CONST.ROLE.PRESENTATION}
ref={inputCallbackRef}
/>

here we did not pass :
autoFocus
shouldDelayFocus

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

pass these

autoFocus
shouldDelayFocu

  1. autoFocus: it will focus the input
  2. shouldDelayFocus: it will open the keyboard.
<InputWrapper 
     InputComponent={TextInput} 
+     autoFocus
+    shouldDelayFocus

@CyberAndrii

This comment was marked as outdated.

@melvin-bot melvin-bot bot added the Overdue label Nov 29, 2024
@Shahidullah-Muffakir
Copy link
Contributor

It's the same issue as #53314 and will be fixed by proposals from there. @sonialiap can we put this on hold and retest later?

@CyberAndrii These issues seem different, but if you believe they are the same, please share your proposal here. Since this issue was created first, any duplicate would typically be closed in favor of this one.

@CyberAndrii
Copy link
Contributor

I don't think your proposals have the correct RCA and solution. We already use useAutoFocusInput() here which should handle the focus. However, there's a bug that prevents InteractionManager.runAfterInteractions callbacks from executing. Also, useAutoFocusInput() is preferred over autoFocus.

@CyberAndrii
Copy link
Contributor

I did some more testing and it appears that specifically in this case InteractionManager callbacks are being blocked by a playing lottie animation on the previous page. If I disable it here by setting autoPlay={false} then autofocus works again.

cc @Themoonalsofall @Shahidullah-Muffakir if you want to investigate this further and update your proposals.

I wasn't able to reproduce this issue on a Pixel 8 Pro emulator so I tried various Browserstack devices and the results are as follows

Reproducible

  • Galaxy A10
  • Redmi Note 12 4G
  • Redmi Note 8

Not reproducible

  • Galaxy S22 Ultra
  • Galaxy S24 Ultra
  • Pixel 6 Pro
  • Pixel 4
  • OnePlus 11R

@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Dec 2, 2024
@melvin-bot melvin-bot bot changed the title mWeb - Workspace - Input is not auto-focused and keyboard doesn't open when creating a tag [$250] mWeb - Workspace - Input is not auto-focused and keyboard doesn't open when creating a tag Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

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

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

melvin-bot bot commented Dec 2, 2024

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

@sonialiap
Copy link
Contributor

@mollfpr we have a few proposals for your review :)

@mollfpr
Copy link
Contributor

mollfpr commented Dec 2, 2024

I don't think your proposals have the correct RCA and solution. We already use useAutoFocusInput() here which should handle the focus.

I agree with @CyberAndrii. Both @Themoonalsofall @Shahidullah-Muffakir proposals don't solve the main issue.

Copy link

melvin-bot bot commented Dec 6, 2024

@sonialiap, @mollfpr Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 6, 2024
@mollfpr
Copy link
Contributor

mollfpr commented Dec 6, 2024

Not overdue 👀

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
@muttmuure muttmuure moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 9, 2024
@linhvovan29546
Copy link
Contributor

I think this is not correct. React Native 0.76 upgrade only applies to native, while this issue appears on mWeb.

Pinging @sonialiap and @mollfpr, in case you may have missed my comment

@mollfpr
Copy link
Contributor

mollfpr commented Jan 7, 2025

@linhvovan29546 I am unable to reproduce the issue on my Samsung phone or with the simulator. What might be causing this?

Screen_Recording_20250107_220516_Chrome.mp4

@linhvovan29546
Copy link
Contributor

@linhvovan29546 I am unable to reproduce the issue on my Samsung phone or with the simulator. What might be causing this?

Screen_Recording_20250107_220516_Chrome.mp4

I can reproduce on my Samsung phone with same step in the OP

@mollfpr
Copy link
Contributor

mollfpr commented Jan 7, 2025

It will be hard if we can't constantly reproduce the issue on the affected platform and I can't confirm if the solution works.

@linhvovan29546
Copy link
Contributor

It will be hard if we can't constantly reproduce the issue on the affected platform and I can't confirm if the solution works.

Honestly, I can still reproduce this issue on staging with my device, but it seems challenging since you are unable to reproduce it on your device.

@melvin-bot melvin-bot bot added the Overdue label Jan 11, 2025
Copy link

melvin-bot bot commented Jan 13, 2025

@sonialiap, @mollfpr Eep! 4 days overdue now. Issues have feelings too...

@linhvovan29546
Copy link
Contributor

@mollfpr I looked into the steps to reproduce the issue. You can test it under high CPU usage conditions.

Copy link

melvin-bot bot commented Jan 15, 2025

@sonialiap, @mollfpr 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Jan 17, 2025

@sonialiap, @mollfpr Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

Copy link

melvin-bot bot commented Jan 21, 2025

@sonialiap, @mollfpr 12 days overdue now... This issue's end is nigh!

@mollfpr
Copy link
Contributor

mollfpr commented Jan 22, 2025

@linhvovan29546 How can I emulate the high CPU usage on the Android emulator? I try to create an AVD with CPU core of 1 and RAM 512MB, but can't reproduce the issue.

@melvin-bot melvin-bot bot removed the Overdue label Jan 22, 2025
@rayane-djouah
Copy link
Contributor

@mollfpr I'm able to reproduce on my physical device if you want me to take over the C+ review

screen-20250123-180334.mp4

@mollfpr
Copy link
Contributor

mollfpr commented Jan 23, 2025

@rayane-djouah Yup, please take over the issue 🙏

@rayane-djouah
Copy link
Contributor

@linhvovan29546's proposal looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 23, 2025

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

@rayane-djouah
Copy link
Contributor

@MonilBhavsar please assign me as well. Thanks!

@rayane-djouah
Copy link
Contributor

We don't need [Hold for React Native 0.76] in the title

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

Is this on HOLD?

@rayane-djouah
Copy link
Contributor

This is not on hold

@MonilBhavsar MonilBhavsar changed the title [Hold for React Native 0.76] [$250] mWeb - Workspace - Input is not auto-focused and keyboard doesn't open when creating a tag [$250] mWeb - Workspace - Input is not auto-focused and keyboard doesn't open when creating a tag Jan 23, 2025
@MonilBhavsar
Copy link
Contributor

Okay thanks! Took it off HOLD. I will review this tomorrow

@rayane-djouah
Copy link
Contributor

@MonilBhavsar kind reminder :)

@MonilBhavsar
Copy link
Contributor

However, the Lottie animation continues running in the background, preventing runAfterInteractions from executing.

Curious to know why it only happens on specific devices, and is this the only place where this issue happens, I don't think so. As we use animations at many places in the App

@linhvovan29546
Copy link
Contributor

Curious to know why it only happens on specific devices.

I'm not sure why this happens on specific devices. I think it may be related to the device's hardware as some of the affected devices can be found here: #53208 (comment) (Thank you to @CyberAndrii for investigating!)

and is this the only place where this issue happens.

The previous screen of the create tag page is the workspace settings tag page, which includes a Lottie animation. And on the create tag page, we use useAutoFocusInput to focus the input field, as mentioned in my proposal.

As we use animations at many places in the App.

For many places in the app, I’ve searched thoroughly and noticed that they are not the same as this case.

In summary, my proposal covers the missing case in mWeb #48444, where the LEFT_MODAL_NAVIGATOR and RIGHT_MODAL_NAVIGATOR are displayed as full-screen views. For better performance, we should pause the lottie animation when a full-screen view is displayed

cc @MonilBhavsar

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

10 participants