Skip to content

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

Closed

Description

@kbecciv

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

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 15, 2023
  2. 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[/+] on Sep 15, 2023
  3. melvin-bot commented on Sep 15, 2023

    @melvin-bot

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

  4. melvin-bot commented on Sep 15, 2023

    @melvin-bot
  5. melvin-bot commented on Sep 15, 2023

    @melvin-bot

    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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 15, 2023
  7. melvin-bot commented on Sep 15, 2023

    @melvin-bot

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

  8. melvin-bot commented on Sep 15, 2023

    @melvin-bot

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

  9. kbecciv commented on Sep 15, 2023

    @kbecciv
    Author

    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

  10. PiyushChandra17 commented on Sep 15, 2023

    @PiyushChandra17
    Contributor

    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

  11. 59 remaining items

  12. Krishna2323 commented on Oct 16, 2023

    @Krishna2323
    Contributor

    @ArekChr, PR ready for review.

  13. melvin-bot commented on Oct 18, 2023

    @melvin-bot

    🎯 ⚡️ 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 🚀

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 20, 2023
  15. 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[/+] on Oct 20, 2023
  16. melvin-bot commented on Oct 20, 2023

    @melvin-bot

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

  17. melvin-bot commented on Oct 20, 2023

    @melvin-bot

    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
  18. melvin-bot commented on Oct 20, 2023

    @melvin-bot

    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:
  19. ArekChr commented on Oct 23, 2023

    @ArekChr
    Contributor
    • 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.
  20. sophiepintoraetz commented on Oct 26, 2023

    @sophiepintoraetz
    Contributor

    Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions