Skip to content

[HOLD for payment 2024-03-07] [$500] Web - IOU - I can't navigate using the "Tab" key #36513

Closed

Description

@lanitochka17

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


Version Number: 1.4.41.1
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open FAB > Request money
  2. Select manual, enter a value and click "Next"
  3. Select a workspace chat
  4. Press the "Tab" key

Expected Result:

I should be able to use it

Actual Result:

I can't navigate using the "Tab" key. It works in task request flow

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

Bug6379431_1707920607011.bandicam_2024-02-14_05-45-36-762.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0144e80c4837a63c84
  • Upwork Job ID: 1757791324532207616
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • cubuspl42 | Reviewer | 0
    • bernhardoj | Contributor | 0

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 14, 2024
  2. changed the title [-]Web - IOU - I can't navigate using the "Tab" key[/-] [+][$500] Web - IOU - I can't navigate using the "Tab" key[/+] on Feb 14, 2024
  3. melvin-bot commented on Feb 14, 2024

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 14, 2024
  5. melvin-bot commented on Feb 14, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 14, 2024

    @melvin-bot

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

  7. lanitochka17 commented on Feb 14, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp
    CC @quinthar

  8. bernhardoj commented on Feb 15, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Can't navigate using the TAB key on the money request page.

    What is the root cause of that problem?

    In #35154, we intentionally disable the TAB to "fix" #26326.

    useEffect(() => {
    const handler = (event) => {
    if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
    return;
    }
    event.preventDefault();
    event.stopPropagation();
    };
    KeyDownPressListener.addKeyDownPressListener(handler);
    return () => KeyDownPressListener.removeKeyDownPressListener(handler);
    }, []);

    But this affected all money request page, including participant and confirmation page.

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

    We should unregister the tab listener when the screen is out focus. We can use useFocusEffect to achieve it.

    useFocusEffect(
        useCallback(() => {
            const handler = (event) => {
                if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
                    return;
                }
                event.preventDefault();
                event.stopPropagation();
            };
            KeyDownPressListener.addKeyDownPressListener(handler);
    
            return () => KeyDownPressListener.removeKeyDownPressListener(handler);
    }, []));
    

    What alternative solutions did you explore? (Optional)

    This isn't the best solution, but just in case. We can store the navigation focus state to a ref and return early if the page is not focused anymore.

  9. jakub-trzebiatowski commented on Feb 15, 2024

    @jakub-trzebiatowski
    Contributor

    @bernhardoj

    Just to confirm, does your solution keep #26326 fixed?

  10. damadoko commented on Feb 15, 2024

    @damadoko

    Proposal

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

    Can not navigate by tab key in request money page.

    What is the root cause of that problem?

    Since #35154 to fix #26326

    useEffect(() => {
    const handler = (event) => {
    if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
    return;
    }
    event.preventDefault();
    event.stopPropagation();
    };
    KeyDownPressListener.addKeyDownPressListener(handler);
    return () => KeyDownPressListener.removeKeyDownPressListener(handler);
    }, []);

    This change disable all tab actions in request money page (which wrapped by IOURequestStartPage component)

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

    1. Revert above code to get back normal behaviors.
    2. Set css attribute: visibility: hidden to not-active TopTab.Screen, all focusable child of that element will not tab(able) anymore.
    <TopTab.Screen name={CONST.TAB_REQUEST.MANUAL}>
      {({navigation}) => {
        const state = navigation.getState();
        if (state?.index === 0) return <IOURequestStepAmount route={route} />;
    
        return (
            <View style={visibility.hidden}>
               <IOURequestStepAmount route={route} />;
             </View>
         );
    }}

    What alternative solutions did you explore? (Optional)

    Above solution need to change all TopTab.Screen implementation. I think about more generic solution which make changes in OnyxTabNavigator's children:

    {React.Children.map(children, (child, i) => {
      if (!React.isValidElement(child) || child.type !== TopTab.Screen || !isFunction(child.props.children)) {
        return child;
      }
    
      return React.cloneElement(child, {
        children: (props) => {
          const state = props?.navigation?.getState();
          if (state.index === i) {
            return child.props.children(props);
          }
          return <View style={visibility.hidden}>{child.props.children(props)}</View>;
        },
      });
    })}
  11. melvin-bot commented on Feb 15, 2024

    @melvin-bot

    📣 @damadoko! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  12. 18 remaining items

  13. bernhardoj commented on Feb 20, 2024

    @bernhardoj
    Contributor

    PR is ready

    cc: @cubuspl42

  14. alexpensify commented on Feb 28, 2024

    @alexpensify
    Contributor

    Update: The PR is waiting for @mountiny's review but I'll try to find a replacement. I think you are offline.

  15. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Feb 29, 2024
  16. changed the title [-][$500] Web - IOU - I can't navigate using the "Tab" key[/-] [+][HOLD for payment 2024-03-07] [$500] Web - IOU - I can't navigate using the "Tab" key[/+] on Feb 29, 2024
  17. melvin-bot commented on Feb 29, 2024

    @melvin-bot

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

  18. melvin-bot commented on Feb 29, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.45-6 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 2024-03-07. 🎊

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

  19. melvin-bot commented on Feb 29, 2024

    @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:

    • [@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
    • [@cubuspl42] 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:
    • [@cubuspl42] 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:
    • [@cubuspl42] Determine if we should create a regression test for this bug.
    • [@cubuspl42] 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.
    • [@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  20. alexpensify commented on Mar 1, 2024

    @alexpensify
    Contributor

    Awesome, looks like automation kicked in here.


    Heads up, I will be offline until Tuesday, March 5, 2024. I will not be actively watching over this GitHub during that period. If anything urgent is needed here, please ask for help in the Open Source Slack Room-- thanks!

  21. alexpensify commented on Mar 8, 2024

    @alexpensify
    Contributor

    Alright, I've completed the payment summary here:

    #36513 (comment)

    For this Upwork Job:

    https://www.upwork.com/jobs/~0144e80c4837a63c84


    Closing - Everyone has been paid via Upwork.

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.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions