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-09-29] [$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig #23986

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

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 1, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

Precondition: user should be logged in and have converation with mesages

  1. Open https://staging.new.expensify.com/
  2. Tap on any listed conversation
  3. Tap in the compose box
  4. Scroll to beginning of the conversation
  5. At the beginning, pull the top of the conversation down, as if to refresh
  6. Scroll back down

Expected Result:

Compose box should be properly displayed

Actual Result:

Compose box becomes overlapped by the keayobard when scroll to the beggining

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

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6149022_Rpreplay_Final1690864458.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause- Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0135c5fbbbebd34a7a
  • Upwork Job ID: 1686574863342690304
  • Last Price Increase: 2023-08-09
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 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 Aug 1, 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

@jscardona12
Copy link
Contributor

Proposal

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

Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig

What is the root cause of that problem?

This is a known issue in safari when the keyboard is open the user is able to scroll thowugh the window messing up with the UI.

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

We should set up a window scroll listener in
in Composer/index.js in componentDidMount we should add the following lines to detect when keyboar is being open on browser iOS:

        window.addEventListener("scroll", () => {
        // if is the first time the window scrolls dave the scrollY to detect if is the right amount of windowScroll
        if(this.state.windowScrollY === -1){
            this.setState({windowScrollY: window.scrollY})
        }
        // if there is a scroll and its not 0(keyboard is hidden) or this.state.windowScrollY (KeyBoard is shown) prevent scroll
        else if(window.scrollY !== 0 && window.scrollY !== this.state.windowScrollY && this.textInput.isFocused()){
           //Prevent Window Scroll
            this.state.windowScrollY !== -1 ? window.scrollTo(0,this.state.windowScrollY) : null;
        }
    });

Without Fix

WhatsApp.Video.2023-08-01.at.12.44.38.PM.mp4

With Fix

WhatsApp.Video.2023-08-01.at.12.44.45.PM.1.mp4

@sophiepintoraetz
Copy link
Contributor

Can dupe:
IMG_1765

@sophiepintoraetz sophiepintoraetz added the External Added to denote the issue can be worked on by a contributor label Aug 2, 2023
@melvin-bot melvin-bot bot changed the title Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig [$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig Aug 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0135c5fbbbebd34a7a

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

melvin-bot bot commented Aug 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

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

@mananjadhav
Copy link
Collaborator

@sophiepintoraetz Can you confirm if the expected behavior should keyboard should be closed while scrolling down? or if the composer + keyboard should be visible?

@Crystalian0322
Copy link

Crystalian0322 commented Aug 3, 2023

Proposal

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

Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig

What is the root cause of that problem?

This is a known issue in safari when the keyboard is open the user is able to scroll thowugh the window messing up with the UI.

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

We should set up a window scroll listener in
in Composer/index.js in componentDidMount we should add the following lines to detect when keyboar is being open on browser iOS:

// Check if the windowScrollY property is undefined
    if (this.windowScrollY === undefined) {
        // If it is undefined, set it to the current scroll position of the window
        this.windowScrollY = window.scrollY;
    }
    // Check if the windowScrollY property is not equal to the current scroll position of the window
    if (this.windowScrollY === -1) {
        // If it is not equal, set it to the current scroll position of the window
        this.windowScrollY = window.scrollY;
    }
    // if there is a scroll and its not 0(keyboard is hidden) or this.state.windowScrollY (KeyBoard is shown) prevent scroll
    if (window.scrollY !== 0 && window.scrollY !== this.windowScrollY) {
        // If the conditions are met, scroll the window back to the stored windowScrollY position
        window.scrollTo(0, this.windowScrollY);

NA

##Result

@studentofcoding
Copy link
Contributor

studentofcoding commented Aug 3, 2023

Proposal

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

Compose box Chat becomes overlapped with the keyboard when scrolling to the top

What is the root cause of that problem?

As the other shared before, this is the familiar problem where the user can scroll through a window thus, the Compose Box become overlapped

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

What we need to do is create handleScroll() function on Composer/index.js and add an Event listener on componentDidMount() to handle handleScroll()

window.addEventListener("scroll", () => {
            this.handleScroll();
        });
...
handleScroll() {
        // Check if the windowScrollY property is undefined
        if (this.windowScrollY === undefined) {
            // If it is undefined, set it to the current scroll position of the window
            this.windowScrollY = window.scrollY;
        }
        // Check if the windowScrollY property is not equal to the current scroll position of the window
        if (this.windowScrollY === -1) {
            // If it is not equal, set it to the current scroll position of the window
            this.windowScrollY = window.scrollY;
        }
        // if there is a scroll and its not 0(keyboard is hidden) or this.state.windowScrollY (KeyBoard is shown) prevent scroll
        if (window.scrollY !== 0 && window.scrollY !== this.windowScrollY) {
            // If the conditions are met, scroll the window back to the stored windowScrollY position
            window.scrollTo(0, this.windowScrollY);
        }
    }

With this solution, we can always see the Compose box appear on the screen, whether it's on Safari or Chrome

What alternative solutions did you explore? (Optional)

  1. Add overscrollBehavior: 'contain', into
    export default {
    overflowHidden: {
    overflow: 'hidden',
    },
    overflowVisible: {
    overflow: 'visible',
    },
    overflowScroll: {
    overflow: 'scroll',
    },
    overscrollBehaviorNone: {
    overscrollBehavior: 'none',
    },
    with
    overscrollContain : {
        overscrollBehavior: 'contain',
    },
  1. Import the styles and Use them into FlatList via style={styles.overscrollContain}

##Result

  • On IOS/Safari
safari_ios.mp4
  • On IOS/Chrome
chrome_ios.mp4

cc: @sophiepintoraetz @mananjadhav

@melvin-bot melvin-bot bot added the Overdue label Aug 7, 2023
@sophiepintoraetz
Copy link
Contributor

My expectation would be that if the cursor is active in the composer box, the keyboard would remain open, right? @mananjadhav

@melvin-bot melvin-bot bot removed the Overdue label Aug 8, 2023
@mananjadhav
Copy link
Collaborator

Thanks for the confirmation. I think we should put this on hold until we merge #23359.

The PR refactors the Composer/index.js to a functional component, which would require changes in the approach here.

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 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 Aug 10, 2023
@sophiepintoraetz sophiepintoraetz changed the title [$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig [HOLD #23359][$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig Aug 10, 2023
@sophiepintoraetz sophiepintoraetz added Weekly KSv2 and removed Daily KSv2 labels Aug 10, 2023
@melvin-bot melvin-bot bot removed the Overdue label Aug 10, 2023
@kosmydel
Copy link
Contributor

Hey, I am from the Software Mansion expert's agency. I know it is on hold, but my changes don't affect the refactor. Here is my proposal:

Proposal

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

When the user scrolls to the beginning of the report and keeps scrolling, the keyboard overflows the input bar.

What is the root cause of that problem?

When the user scrolls to the beginning of the report, the browser allows the user to continue scrolling, which leads to scrolling the container (the entire page).

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

In my opinion, the above solutions overcomplicate this issue. I believe, that the only thing we have to do is to add this style to the FlatList:

style={{overscrollBehavior: 'contain'}}

This styling will block (docs) the scrolling when the user comes to the beginning of the report.

Demo

demo.mov

What alternative solutions did you explore? (Optional)

I don't think that we need to overcomplicate it.

@mananjadhav
Copy link
Collaborator

mananjadhav commented Aug 13, 2023

Okay while the other issue is still in progress, I can @kosmydel's proposal looks good. I will have to test the scroll behavior on all cases, but based on the docs it should work. Also it shouldn't get blocked by the refactor.

cc - @sophiepintoraetz @neil-marcellini

🎀 👀 🎀 C+ reviewed.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Aug 16, 2023
@kosmydel
Copy link
Contributor

Hey @neil-marcellini , can I ask for the assignment?

@neil-marcellini
Copy link
Contributor

I'll review today

@neil-marcellini
Copy link
Contributor

Wow, great proposal @kosmydel! You're hired.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($1000)

@neil-marcellini neil-marcellini changed the title [HOLD #23359][$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig [$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig Aug 17, 2023
@kosmydel
Copy link
Contributor

Hey, thanks!
I've prepared a PR for that. Do you want me to add this style to other FlatList's as well?

@neil-marcellini
Copy link
Contributor

If you're confident it won't break anything else, than sure. Otherwise let's keep the scope limited.

@mananjadhav
Copy link
Collaborator

I would recommend keep the scope limited, let it go through staging QA, and then create a follow up issue.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Aug 21, 2023
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

This issue has not been updated in over 15 days. @mananjadhav, @neil-marcellini, @sophiepintoraetz, @kosmydel eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@mananjadhav
Copy link
Collaborator

PR is merged and currently deployed to staging.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig [HOLD for payment 2023-09-29] [$1000] Chat - Compose box becomes overlapped by the keyboard when sroll to the begginig Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊

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:

  • @mananjadhav does not require payment (Eligible for Manual Requests)
  • @kosmydel does not require payment (Contractor)

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 Sep 22, 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:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] 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:
  • [@mananjadhav] 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:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] 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:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 29, 2023
@sophiepintoraetz
Copy link
Contributor

All right:

  • Applause reported
  • @mananjadhav - please raise a manual request for $1000 once you have completed the checklist
  • @kosmydel is from agency so no payments here.

@JmillsExpensify
Copy link

$1,000 payment approved for @mananjadhav based on BZ summary.

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants