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] iOS Hybrid - Composer - Keyboard does not reopen after dismissing the context menu #50830

Closed
6 tasks
lanitochka17 opened this issue Oct 15, 2024 · 16 comments
Closed
6 tasks
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Hourly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 15, 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.49-0
Reproducible in staging?: Y
Reproducible in production?: N
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): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch New Expensify app
  2. Go to DM
  3. Send a message
  4. With keyboard up, long press on the message
  5. Tap outside the context menu

Expected Result:

The keyboard will reopen after dismissing the context menu (production behavior and staging mweb behavior)

Actual Result:

The keyboard does not reopen after dismissing the context menu

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6635613_1729019252899.ScreenRecording_10-16-2024_03-02-03_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021846522126717879513
  • Upwork Job ID: 1846522126717879513
  • Last Price Increase: 2024-10-16
Issue OwnerCurrent Issue Owner: @Ollyws
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

Triggered auto assignment to @flodnv (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Oct 15, 2024

💬 A slack conversation has been started in #expensify-open-source

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@marcaaron
Copy link
Contributor

Reproducible in production?: Y

So, not a blocker right?

@lanitochka17
Copy link
Author

sorry, my mistake.
Reproducible in production?: N

@flodnv flodnv added the External Added to denote the issue can be worked on by a contributor label Oct 16, 2024
@melvin-bot melvin-bot bot changed the title iOS Hybrid - Composer - Keyboard does not reopen after dismissing the context menu [$250] iOS Hybrid - Composer - Keyboard does not reopen after dismissing the context menu Oct 16, 2024
Copy link

melvin-bot bot commented Oct 16, 2024

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

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

melvin-bot bot commented Oct 16, 2024

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

@daledah
Copy link
Contributor

daledah commented Oct 16, 2024

Proposal

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

The keyboard does not reopen after dismissing the context menu

What is the root cause of that problem?

When users press + button, we will blur the composer

Even we have the logic to refocus in

but it's prevented by willBlurTextInputOnTapOutside, that is set to false in native device

if (!((willBlurTextInputOnTapOutside || shouldAutoFocus) && !isNextModalWillOpenRef.current && !modal?.isVisible && isFocused && (!!prevIsModalVisible || !prevIsFocused))) {
return;
}

-> the focus logic doesn't run

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

Since we don't want to call focus when the modal get closed

// We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused.
// We avoid doing this on native platforms since the software keyboard popping
// open creates a jarring and broken UX.

-> we shouldn't blur it if willBlurTextInputOnTapOutside is false

We can update onAddActionPressed

    const onAddActionPressed = useCallback(() => {
        if (!willBlurTextInputOnTapOutside) {
            isKeyboardVisibleWhenShowingModalRef.current = !!composerRef.current?.isFocused();
            return;
        }
        composerRef.current?.blur();
    }, []);

What alternative solutions did you explore? (Optional)

We face the same issue when users long press on report action so we can apply the same solution in

ReportActionComposeFocusManager.blurAll();

@flodnv
Copy link
Contributor

flodnv commented Oct 16, 2024

@daledah any idea which PR caused this?

@daledah
Copy link
Contributor

daledah commented Oct 16, 2024

@flodnv I think we changed it on purpose here #48415

@daledah
Copy link
Contributor

daledah commented Oct 16, 2024

@flodnv If we decide to hide the keyboard, we can refactor/remove this hook

since it's used to focus or refocus the input when a modal has been closed

@rezkiy37
Copy link
Contributor

rezkiy37 commented Oct 16, 2024

It is not a bug. This is the expected behavior now. That's a PR where it was changed. Proposal.

@daledah
Copy link
Contributor

daledah commented Oct 16, 2024

@rezkiy37 Should we remove this hook #50830 (comment)

@rezkiy37
Copy link
Contributor

@rezkiy37 Should we remove this hook #50830 (comment)

Just to clarify: this is the expected result.

Actual Result:
The keyboard does not reopen after dismissing the context menu

So I don't think we should touch something. So just close the issue.

@flodnv flodnv removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 16, 2024
@flodnv
Copy link
Contributor

flodnv commented Oct 16, 2024

Thanks for the clarification and details @rezkiy37, I agree with you 👍

@flodnv flodnv closed this as completed Oct 16, 2024
@daledah
Copy link
Contributor

daledah commented Oct 16, 2024

@rezkiy37

The keyboard does not reopen after dismissing the context menu

That why I think we can remove this hook. It's used to re-focus, but you change willBlurTextInputOnTapOutside to false on native and mweb -> the logic here never runs

// We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused.
// We avoid doing this on native platforms since the software keyboard popping
// open creates a jarring and broken UX.

@marcaaron marcaaron removed the DeployBlockerCash This issue or pull request should block deployment label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Hourly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants