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

BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan #11970

Closed
kavimuru opened this issue Oct 18, 2022 · 45 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Oct 18, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Action performed:
  2. Open any conversation
  3. Open keyboard
  4. Close chat by swiping from left to right

Expected Result:

keyboard should be closed

Actual Result:

keyboard remains open

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Mobile Web - Safari

Version Number: v1.2.17-4
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

https://user-images.githubusercontent.com/43996225/196539070-780a6b4d-9ab4-495f-a592-f428a83e9986.MP4
https://user-images.githubusercontent.com/43996225/196539158-b33a7547-3df2-490d-ba7a-8766dcf6fb03.mp4

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1666117289545729

View all open jobs on GitHub

@kavimuru kavimuru added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Oct 18, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2022

Triggered auto assignment to @sakluger (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@melvin-bot melvin-bot bot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Oct 18, 2022
@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@sakluger
Copy link
Contributor

I updated the 4th Action Performed to relect the video (previously it said Open the chat by swiping from right to left, but the video showed the user closing the chat by swiping from left to right).

I was able to reproduce the issue in mobile Safari, and confirmed that there are no other open issues for this bug.

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Oct 20, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2022

Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2022

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

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

melvin-bot bot commented Oct 20, 2022

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

@melvin-bot melvin-bot bot changed the title BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan [$250] BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan Oct 20, 2022
@sakluger
Copy link
Contributor

@sakluger sakluger added Weekly KSv2 and removed Daily KSv2 labels Oct 20, 2022
@Nodirbek75
Copy link

This issue can be solved by adding listener "beforeRemove" and inside function closing keyboard manually.

@Babur171
Copy link

You can use KeyboardAvoidingView in scrollView. Then you solve this issue

@rushatgabhane
Copy link
Member

rushatgabhane commented Oct 21, 2022

@Nodirbek75 @Babur171 thanks for your proposal!

Could you please explain why the issue is happening and how exactly you plan to fix it?
We expect a brief technical writeup from propsals. (you can take a look at a few closed issues that have a proposal)

@Babur171
Copy link

@rushatgabhane can you share me your code?

@rushatgabhane
Copy link
Member

@Babur171 I recommend that you read contributing.md before starting. All the code is available on https://github.com/Expensify/App

@sakluger sakluger changed the title [$250] BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan [$500] BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan Nov 1, 2022
@melvin-bot melvin-bot bot added the Overdue label Nov 1, 2022
@sakluger
Copy link
Contributor

sakluger commented Nov 1, 2022

Price doubled!

@melvin-bot melvin-bot bot removed the Overdue label Nov 1, 2022
@rushatgabhane
Copy link
Member

@sakluger time to double?

@s77rt
Copy link
Contributor

s77rt commented Nov 11, 2022

I can't reproduce, maybe it's fixed already?

@s77rt
Copy link
Contributor

s77rt commented Nov 16, 2022

Proposal

diff --git a/src/libs/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js
index e937e5015..8c484ce1e 100644
--- a/src/libs/Navigation/Navigation.js
+++ b/src/libs/Navigation/Navigation.js
@@ -1,6 +1,5 @@
 import _ from 'underscore';
 import lodashGet from 'lodash/get';
-import {Keyboard} from 'react-native';
 import {DrawerActions, getPathFromState, StackActions} from '@react-navigation/native';
 import Onyx from 'react-native-onyx';
 import Log from '../Log';
@@ -66,7 +65,6 @@ function openDrawer() {
     }
 
     navigationRef.current.dispatch(DrawerActions.openDrawer());
-    Keyboard.dismiss();
 }
 
 /**
diff --git a/src/libs/Navigation/NavigationRoot.js b/src/libs/Navigation/NavigationRoot.js
index 775d89f31..9dba24585 100644
--- a/src/libs/Navigation/NavigationRoot.js
+++ b/src/libs/Navigation/NavigationRoot.js
@@ -1,5 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
+import {Keyboard} from 'react-native';
 import {NavigationContainer, DefaultTheme, getPathFromState} from '@react-navigation/native';
 import {useFlipper} from '@react-navigation/devtools';
 import Navigation, {navigationRef} from './Navigation';
@@ -60,7 +61,10 @@ const NavigationRoot = (props) => {
                     style={styles.navigatorFullScreenLoading}
                 />
             )}
-            onStateChange={parseAndLogRoute}
+            onStateChange={() => {
+                Keyboard.dismiss();
+                parseAndLogRoute();
+            }}
             onReady={props.onReady}
             theme={navigationTheme}
             ref={navigationRef}

Details

The issue is more like a bug in Safari I suppose. The swipe gesture in Safari will trigger the browser back functionality. On chrome the browser back functionality also closes the keyboad. On Safari you have to do it yourself. Building on that we can simply call Keyboard.dismiss() on navigation change and since I see no case where the keyboard should stay open after navigation change I have put the logic on the root NavigationContainer.

Kooha-2022-11-16-15-48-11.mp4

There is another similar issue which is more annoying that effects all the browsers (maybe native devices too) which is related to modals; Open any modal (e.g. Emoji Picker) press back button / swipe. The modal will stay there and will cause the app to be unusable. I do have a fix for that but I didn't include it in my above proposal; You can think that this can be solved using the same approach used here (on navigation change, close modal) but i have a better solution to fix the modal itself I have two proposals already that covers this #10414 (comment) and #12521 (comment)

@JmillsExpensify
Copy link

Switched out weekly for monthly given that the navigation project is large and has no defined ETA.

@JmillsExpensify
Copy link

Still on hold for the navigation project.

@melvin-bot melvin-bot bot added the Overdue label Feb 13, 2023
@JmillsExpensify
Copy link

Same same.

@melvin-bot melvin-bot bot removed the Overdue label Feb 14, 2023
@melvin-bot melvin-bot bot added the Overdue label Mar 17, 2023
@deetergp
Copy link
Contributor

Still in a holding pattern

@melvin-bot melvin-bot bot removed the Overdue label Mar 21, 2023
@JmillsExpensify
Copy link

Same same.

@melvin-bot melvin-bot bot added the Overdue label May 1, 2023
@deetergp
Copy link
Contributor

deetergp commented May 2, 2023

Still on hold.

@melvin-bot melvin-bot bot removed the Overdue label May 2, 2023
@melvin-bot melvin-bot bot added the Overdue label Jun 2, 2023
@deetergp
Copy link
Contributor

deetergp commented Jun 3, 2023

MOTS (more of the same)

@melvin-bot melvin-bot bot removed the Overdue label Jun 3, 2023
@mountiny mountiny changed the title [HOLD #11768] BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan Jun 22, 2023
@JmillsExpensify
Copy link

Alright, circling back on this one, I'm no longer able to reproduce. The keyboard consistently closes when going back to the LHN from a chat.

RPReplay_Final1687812788.MP4

Accordingly, I think we're ready to pay @gadhiyamanan for reporting. If anyone disagrees or is able to achieve a different result, please comment in this issue. We'll be closing out payments later this week.

@kevinksullivan kevinksullivan changed the title BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan [HOLD] BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan Jul 26, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 28, 2023
@deetergp
Copy link
Contributor

@JmillsExpensify Have we paid @gadhiyamanan for reporting? Can we close this one out?

@melvin-bot melvin-bot bot removed the Overdue label Jul 30, 2023
@JmillsExpensify
Copy link

Not yet, still working through issues. Though I will aim to circle back on this soon.

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@deetergp
Copy link
Contributor

deetergp commented Sep 6, 2023

I believe we are still holding.

@melvin-bot melvin-bot bot removed the Overdue label Sep 6, 2023
@JmillsExpensify
Copy link

Alright, ready to close this out. @gadhiyamanan I've just send you an offer for reporting on Upwork.

@gadhiyamanan
Copy link
Contributor

@JmillsExpensify offer accepted, thanks!

@JmillsExpensify
Copy link

All paid out! Thank you, closing.

@JmillsExpensify JmillsExpensify changed the title [HOLD] BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan BUG: [mweb-safari] keyboard remains open while navigating back to LHN using fingers from right to left reported by @gadhiyamanan Oct 8, 2023
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 Monthly KSv2
Projects
None yet
Development

No branches or pull requests