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

[HOLD for payment 2023-10-27] [$500] Android - Keyboard stays open when getting back to amount input page #27543

Closed
1 of 6 tasks
kbecciv opened this issue Sep 15, 2023 · 43 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 15, 2023

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. Open any report
  2. Request money
  3. Click on the currency sign & try to select any currency asap
  4. Try few times
  5. Observe the keyboard stays open few times.

Expected Result:

The keyboard should be closed on the amount input page.

Actual Result:

The keyboard is not closed on the amount input page.

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.70.2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

WhatsApp.Video.2023-09-08.at.05.01.04.2.mp4
Record_2023-09-15-14-46-58_4f9154176b47c00da84e32064abf1c48.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Krishna2323
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694209564341799

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c8a396e607bd78b9
  • Upwork Job ID: 1702718401323413504
  • Last Price Increase: 2023-10-06
  • Automatic offers:
    • Krishna2323 | Contributor | 27221285
    • Krishna2323 | Reporter | 27221287
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 15, 2023
@melvin-bot melvin-bot bot changed the title Android - Keyboard stays open when getting back to amount input page [$500] Android - Keyboard stays open when getting back to amount input page Sep 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

Triggered auto assignment to @sophiepintoraetz (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Sep 15, 2023

Proposal by: @Krishna2323
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694209564341799

Proposal

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

Android - Keyboard stays open when getting back to amount input page

What is the root cause of that problem?

The root cause is the use of keyboardShouldPersistTaps="always" on SectionList used in the BaseOptionsList. This property essentially dictates that the keyboard should remain open even after a tap on the screen (like selecting an any result).

<SectionList
ref={innerRef}
nestedScrollEnabled
style={listStyles}
indicatorStyle="white"
keyboardShouldPersistTaps="always"
keyboardDismissMode={keyboardDismissMode}
onScrollBeginDrag={onScrollBeginDrag}
onScroll={onScroll}
contentContainerStyle={contentContainerStyles}
showsVerticalScrollIndicator={showScrollIndicator}
sections={sections}
keyExtractor={extractKey}
stickySectionHeadersEnabled={false}
renderItem={renderItem}
getItemLayout={getItemLayout}
renderSectionHeader={renderSectionHeader}
extraData={focusedIndex}
initialNumToRender={12}
maxToRenderPerBatch={5}
windowSize={5}
viewabilityConfig={{viewAreaCoveragePercentThreshold: 95}}
onViewableItemsChanged={onViewableItemsChanged}
/>

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

We need to dismiss keyboard by using Keyboard.dismiss() before navigating with back button or navigating using confirmCurrencySelection function.

const confirmCurrencySelection = useCallback(
(option) => {
const backTo = lodashGet(props.route, 'params.backTo', '');
// When we refresh the web, the money request route gets cleared from the navigation stack.
// Navigating to "backTo" will result in forward navigation instead, causing disruption to the currency selection.
// To prevent any negative experience, we have made the decision to simply close the currency selection page.
if (_.isEmpty(backTo) || props.navigation.getState().routes.length === 1) {
Navigation.goBack();
} else {
Navigation.navigate(`${props.route.params.backTo}?currency=${option.currencyCode}`);
}
},
[props.route, props.navigation],
);

I also tried to dismiss the keyboard using cleanup function but it didn't worked.
useEffect(() => () => Keyboard.dismiss(), []);

Result

@PiyushChandra17
Copy link

PiyushChandra17 commented Sep 15, 2023

Proposal

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

The keyboard is not closed on the amount input page.

What is the root cause of that problem?

We are using keyboardShouldPersistTaps="always" in BaseOptionsList. This basically means that Keyboard should stay visible after a tap, and "always" means it will not dismiss automatically. This is the root cause.

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

We need to add Keyboard.dismiss() right AFTER navigating with back button AND navigating using confirmCurrencySelection function.

const confirmCurrencySelection = useCallback(
(option) => {
const backTo = lodashGet(props.route, 'params.backTo', '');
// When we refresh the web, the money request route gets cleared from the navigation stack.
// Navigating to "backTo" will result in forward navigation instead, causing disruption to the currency selection.
// To prevent any negative experience, we have made the decision to simply close the currency selection page.
if (_.isEmpty(backTo) || props.navigation.getState().routes.length === 1) {
Navigation.goBack();
} else {
Navigation.navigate(`${props.route.params.backTo}?currency=${option.currencyCode}`);
}
},
[props.route, props.navigation],
);

            if (_.isEmpty(backTo) || props.navigation.getState().routes.length === 1) {
                Navigation.goBack();
                Keyboard.dismiss()
            } else {
                Navigation.navigate(`${props.route.params.backTo}?currency=${option.currencyCode}`);
                Keyboard.dismiss()
            }

What alternative solutions did you explore? (Optional)

NA

@strepanier03
Copy link
Contributor

While testing this the behavior I run into is that the keyboard is momentarily kept open but then closes after a second or two. I haven't been able to successfully get the keyboard to stay open.

@Krishna2323
Copy link
Contributor

@strepanier03, you need to select an option that will be hidden when keyboard opens.
@kbecciv, can you pls update the steps to reproduce.

@sophiepintoraetz
Copy link
Contributor

@strepanier03 - FYI, if the Applause team have applied the External label, you do not need to replicate it (as Applause already have). We just need to check it's a) not a feature and b) not a duplicate.

@ArekChr
Copy link
Contributor

ArekChr commented Sep 18, 2023

While the keyboardShouldPersistTaps="always" setting does keep the keyboard open, I believe the root issue may be with React Native's input handling itself.

The input component should programmatically blur and dismiss the keyboard when removing the screen. This would be a more robust solution, ensuring the keyboard doesn't remain open across different parts of the application.

@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@sophiepintoraetz
Copy link
Contributor

@ArekChr - are you saying that this is more of a feature request rather than a bug fix or you saying that the proposals don't encompass programatically blur and dismiss the keyboard?

@melvin-bot melvin-bot bot removed the Overdue label Sep 22, 2023
@ArekChr
Copy link
Contributor

ArekChr commented Sep 22, 2023

@sophiepintoraetz, I believe the root cause lies in the react-native repo. The proposal from @Krishna2323 looks good as a workaround. However, I'm still waiting for more proposals.

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

📣 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 Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@sophiepintoraetz
Copy link
Contributor

Still waiting on more proposals - will increase the bounty towards the end of the week if there isn't anything.

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@Beamanator
Copy link
Contributor

Seems like we reproduced this, right @ArekChr ? If so, I'll remove the Needs Reproduction label

@Beamanator Beamanator added External Added to denote the issue can be worked on by a contributor and removed Internal Requires API changes or must be handled by Expensify staff labels Oct 16, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 16, 2023
@Beamanator Beamanator removed Needs Reproduction Reproducible steps needed Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

Offer link
Upwork job

@Krishna2323
Copy link
Contributor

@ArekChr, PR ready for review.

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

🎯 ⚡️ Woah @ArekChr / @Krishna2323, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @Krishna2323 got assigned: 2023-10-16 14:26:46 Z
  • when the PR got merged: 2023-10-18 09:06:53 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 20, 2023
@melvin-bot melvin-bot bot changed the title [$500] Android - Keyboard stays open when getting back to amount input page [HOLD for payment 2023-10-27] [$500] Android - Keyboard stays open when getting back to amount input page Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.87-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-27. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@ArekChr] The PR that introduced the bug has been identified. Link to the PR:
  • [@ArekChr] 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:
  • [@ArekChr] A discussion in #expensify-bugs 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:
  • [@ArekChr] Determine if we should create a regression test for this bug.
  • [@ArekChr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@sophiepintoraetz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@ArekChr
Copy link
Contributor

ArekChr commented Oct 23, 2023

  • Link to the PR: No bug identified, this is react-native issue.
  • Link to comment: n/a
  • Link to discussion: n/a
  • Determine if we should create a regression test for this bug: I don’t think we need to add a regression test here.

@sophiepintoraetz
Copy link
Contributor

Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants