Skip to content

[Due for payment 2025-03-11] [$250] Status - With status message entered, save button hidden behind keypad on opening #53692

Closed

Description

@IuliiaHerets

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: V9. 0.72-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app in both mweb and app
  2. Open settings -- profile--status
  3. Note save button can be be seen when status message is empty
  4. Enter a status message and save
  5. Open the status option again

Expected Result:

With status message entered, save button must not be hidden behind keypad on opening status page.

Actual Result:

With status message entered, save button hidden behind keypad on opening status page.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6686106_1733471673686.Screenrecorder-2024-12-06-13-15-46-740_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866149099136907717
  • Upwork Job ID: 1866149099136907717
  • Last Price Increase: 2025-02-03
  • Automatic offers:
    • allgandalf | Reviewer | 105979836
    • huult | Contributor | 105979837
Issue OwnerCurrent Issue Owner: @allgandalf

Activity

  1. added
    Daily
    Bug
    on Dec 6, 2024
  2. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. added
    External
    on Dec 9, 2024
  4. changed the title [-]Status - With status message entered, save button hidden behind keypad on opening[/-] [+][$250] Status - With status message entered, save button hidden behind keypad on opening[/+] on Dec 9, 2024
  5. melvin-bot commented on Dec 9, 2024

    @melvin-bot
  6. added
    Help Wanted
    on Dec 9, 2024
  7. melvin-bot commented on Dec 9, 2024

    @melvin-bot

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

  8. M00rish commented on Dec 10, 2024

    @M00rish
    Contributor

    Edited by proposal-police: This proposal was edited at 2023-10-07T06:34:00Z.

    Proposal

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

    Status - With status message entered, save button hidden behind keypad on opening.

    What is the root cause of that problem?

    the issue happens when the clear status element is added after we type something in, that element takes space and so the save button will be pushed down for lack of space.

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

    check if clear status element should be present:

    const shouldShowClearStatus = !!currentUserEmojiCode || !!currentUserStatusText 
    

    and only if shouldShowClearStatus is true scroll down:

     useEffect(() => {
            if (!shouldShowClearStatus) {
                return;
            }
            InteractionManager.runAfterInteractions(() => {
                requestAnimationFrame(() => {
                    formRef.current?.scrollToEnd({animated: true});
                });
            });
        }, [shouldShowClearStatus]);
    

    and obviously, we use the shouldShowClearStatus instead in the component:

    {(!!currentUserEmojiCode || !!currentUserStatusText) && (
    <MenuItem
    title={translate('statusPage.clearStatus')}
    titleStyle={styles.ml0}
    icon={Expensicons.Trashcan}
    onPress={clearStatus}
    iconFill={theme.danger}
    wrapperStyle={[styles.pl2]}
    />
    )}

    { shouldShowClearStatus  && (
                            <MenuItem
                                title={translate('statusPage.clearStatus')}
                                titleStyle={styles.ml0}
                                icon={Expensicons.Trashcan}
                                onPress={clearStatus}
                                iconFill={theme.danger}
                                wrapperStyle={[styles.pl2]}
                            />
                      )}
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    UI issue

    What alternative solutions did you explore? (Optional)

  9. huult commented on Dec 11, 2024

    @huult
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-12-16 15:04:30 UTC.

    Proposal

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

    With status message entered, save button hidden behind keypad on opening

    What is the root cause of that problem?

    The RCA of this issue is that the available height is not sufficient to display all elements when the keyboard opens. As a result, the keyboard overlaps the button, and scrolling is required to access it.
    This issue commonly occurs on smaller devices like the iPhone SE...

    Screen.Recording.2024-12-11.at.21.49.24.mov

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

    To resolve this issue, we should scroll the form to the end when the keyboard opens to prevent the keyboard from overlapping the button, ensuring the button is visible as expected. To implement this, follow the steps below:

    1. FormWrapper receives a new prop shouldScrollToEnd and sets up useEffect to trigger scrolling.

    function FormWrapper({

      function FormWrapper({
          onSubmit,
          children,
          errors,
          inputRefs,
          submitButtonText,
          footerContent,
          isSubmitButtonVisible = true,
          style,
          submitButtonStyles,
          submitFlexEnabled = true,
          enabledWhenOffline,
          isSubmitActionDangerous = false,
          formID,
          shouldUseScrollView = true,
          scrollContextEnabled = false,
          shouldHideFixErrorsAlert = false,
          disablePressOnEnter = false,
          isSubmitDisabled = false,
          shouldScrollToEnd = false,
      }: FormWrapperProps) {
       useEffect(() => {
            if (!shouldScrollToEnd) {
                return;
            }
            InteractionManager.runAfterInteractions(() => {
                requestAnimationFrame(() => {
                    formRef.current?.scrollToEnd({animated: true});
                });
            });
        }, [shouldScrollToEnd]);
    1. Enable the new prop shouldScrollToEnd to trigger scrolling to the end when visiting the status page

    const {keyboardHeight} = useKeyboardState();
       <FormProvider
          formID={ONYXKEYS.FORMS.SETTINGS_STATUS_SET_FORM}
          style={[styles.flexGrow1, styles.flex1]}
          ref={formRef}
          submitButtonText={translate('statusPage.save')}
          submitButtonStyles={[styles.mh5, styles.flexGrow1]}
          onSubmit={updateStatus}
          validate={validateForm}
          enabledWhenOffline
          shouldScrollToEnd
          // shouldScrollToEnd={keyboardHeight !== 0}
      >
    1. we need shouldEnableMaxHeight in ScreenWrapper.
    POC
    Screen.Recording.2024-12-11.at.22.57.34.mp4

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    This is a UI bug; I don’t think we need to test it

    What alternative solutions did you explore? (Optional)

    When the text input is focused, we scroll it to the top to maximize the visibility of the elements below.

    1. Expose scrollTo for FormProvider

    const scrollTo = (e: number) => {
    formRef.current?.scrollTo(e);
    };

    useImperativeHandle(forwardedRef, () => ({
    scrollTo: (e) => {
    InteractionManager.runAfterInteractions(() => {
    requestAnimationFrame(() => {
    setTimeout(() => {
    formRef.current?.scrollTo({
    y: e,
    animated: false,
    });
    }, 500);
    });
    });
    },
    }));

    1. When the TextInput is focused, meaning the keyboard is open, we scroll the TextInput to the top to maximize the visibility of the elements below it (68 is height of label)

    onFocus={() => {
    inputRef.current.measure((fx, fy, width, height, px, py) => {
    formRef.current?.scrollTo(py - 68);
    });
    }}

    POC
    Screen.Recording.2024-12-16.at.23.28.44.mov

    Test branch

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  10. 83 remaining items

  11. added
    Awaiting Payment
    on Mar 4, 2025
  12. changed the title [-][$250] Status - With status message entered, save button hidden behind keypad on opening[/-] [+][Due for payment 2025-03-11] [$250] Status - With status message entered, save button hidden behind keypad on opening[/+] on Mar 4, 2025
  13. melvin-bot commented on Mar 4, 2025

    @melvin-bot

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

  14. removed
    Reviewing
    on Mar 4, 2025
  15. melvin-bot commented on Mar 4, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.8-1 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 2025-03-11. 🎊

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

  16. melvin-bot commented on Mar 4, 2025

    @melvin-bot

    @allgandalf @lschurr @allgandalf The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  17. lschurr commented on Mar 10, 2025

    @lschurr
    Contributor

    @allgandalf could you work on the checklist for this one?

  18. allgandalf commented on Mar 10, 2025

    @allgandalf
    Contributor

    sure, will complete tomorrow, please put this back to daily

  19. added
    Daily
    and removed
    Weekly
    on Mar 11, 2025
  20. lschurr commented on Mar 11, 2025

    @lschurr
    Contributor

    Payment summary:

  21. lschurr commented on Mar 11, 2025

    @lschurr
    Contributor

    We can close once the checklist is complete @allgandalf :)

  22. allgandalf commented on Mar 12, 2025

    @allgandalf
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other: This existed from the start

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: N/A (this existed for smaller screens from the start)

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    1. Launch the app on both mobile web (mWeb) and the mobile app.
    2. Navigate to Settings → Profile → Status.
    3. Check if the Save button is visible when the status message is empty.
    4. Enter a status message and tap Save.
    5. Reopen the Status option from Profile → Status.

    Verify that the Save button is not hidden behind the keyboard.

    Do we agree 👍 or 👎

  23. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions