-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Chat - Scrolling down on edit composer with multi lines scrolls up the chat history #30987
Comments
Job added to Upwork: https://www.upwork.com/jobs/~014595e5e6d6d7b727 |
Triggered auto assignment to @zanyrenney ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale ( |
What a coincidence that I just reported this scroll issue a few hours ago on the slack channel 😄 ProposalPlease re-state the problem that we are trying to solve in this issue.Scrolling on an edit composer will reverse-scroll the chat pages. What is the root cause of that problem?This is a regression from #27429. In that PR, we want to fix a App/src/components/Composer/index.js Line 388 in 8d6fc37
The warning told us to pass App/src/components/Composer/index.js Lines 334 to 345 in 8d6fc37
Notice the comment, and that the For some reason, passing the What changes do you think we should make in order to solve the problem?Because we already remove the What alternative solutions did you explore? (Optional)If we want the |
@bernhardoj I tested your proposed solution but the composer exhibits the same behaviour in reverse. Scrolling down to the end doesn't scroll the report, but scrolling up does (even when the composer content is scrollable, ie. 15+ lines or more). |
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Scrolling down on edit composer with multi lines scrolls up the chat history What is the root cause of that problem?The input handle wheel to correct scroll top but when hover on input and start scroll over input the parent also receive an event What changes do you think we should make in order to solve the problem?To avoid scroll over text input we can add const inputStyleMemo = useMemo(
() => [
// We are hiding the scrollbar to prevent it from reducing the text input width,
// so we can get the correct scroll height while calculating the number of lines.
numberOfLines < maxLines ? styles.overflowHidden : {},
StyleSheet.flatten([style, {outline: 'none'}]),
StyleUtils.getComposeTextAreaPadding(numberOfLines, isComposerFullSize),
Browser.isMobileSafari() || Browser.isSafari() ? styles.rtlTextRenderForSafari : {},
+ styles.overscrollBehaviorContain,
],
[style, maxLines, numberOfLines, isComposerFullSize],
); and disable + const hasScroll = useMemo(() => numberOfLines > maxLines, [numberOfLines, maxLines]);
useEffect(() => {
......
if (textInput.current) {
document.addEventListener('paste', handlePaste);
+ if (hasScroll) {
textInput.current.addEventListener('wheel', handleWheel, supportsPassive ? {passive: true} : false);
+ }
}
......
}, [hasScroll]); POC 30987.mp4What alternative solutions did you explore? (Optional)Add |
ProposalPlease re-state the problem that we are trying to solve in this issue
What is the root cause of that problem?
App/src/components/Composer/index.js Line 388 in 0cb9969
App/src/components/Composer/index.js Lines 338 to 345 in 0cb9969
What changes do you think we should make in order to solve the problem?
Result new.movWhat alternative solutions did you explore? (Optional) |
@akinwale it works fine on me. Screen.Recording.2023-11-09.at.08.26.49.movFor my main solution, you need to remove the wheel listener App/src/components/Composer/index.js Line 388 in dee9b31
|
@bernhardoj Thanks. I retested and it works as expected. @bernhardoj's proposal correctly identifies the root cause and the proposed solution is simple and adequate. Since it is the first proposal that fixes the problem, we can move forward with it. 🎀 👀 🎀 C+ reviewed. |
Triggered auto assignment to @tgolen, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
PR is ready |
@zanyrenney Automation seems to have missed this issue. The PR was deployed to production on 2023-11-22, so payment should have been due on 2023-11-29. It's now overdue by 1 week. Thanks. |
bump @zanyrenney for the above ^ |
payment summary $0 reporting bonus - done by applause |
@zanyrenney the job is no longer available |
@zanyrenney hi, can you please check the upwork job? |
Ugh yep now its closed. I'll recreate for you @bernhardoj please apply ASAP, I am OOO from tomorrow. |
@bernhardoj |
@zanyrenney accepted. Thanks! |
$500 - c @bernhardoj PAID |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.3.96.0
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:
Issue found when executing PR #30857
Action Performed:
Expected Result:
When scrolling down on the edit composer, the chat view will not be scrolled.
Actual Result:
When scrolling down on the edit composer, the chat view scrolls up. When scrolled to the top of the chat, user is unable to reach the latest message with the edit view as it is scrolling back up.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6267210_1699356584644.20231107_131212.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: