You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] mweb/Chrome - Chat - Edit message after sending attachment, composer box isn't fit on screen #65361
Version Number: 9.1.73-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: N/A Email or phone of affected tester (no customers): gmail account Issue reported by: Applause - Internal Team
I think the reason for the bug is that we currently don't have the scroll to element with composer focus working correctly
2025-07-03.00.36.45.mov
Here are one of the two: Either it's a regression from some change that was overlooked or it's after some library was updated, because a task was created for this earlier and that part of the code is still here:
As you can see from the screenshots, it worked at that moment
In general, as for me, the main problem here is that on Android mweb the keyboard appears almost instantly when the field is focused. This is the default behavior and we probably can't override it. If you compare it with other environments, you can see that the scroll happens first, and only then the keyboard appears.
Therefore, it would be possible to scroll for isMobileChrome after the keyboard appears, but the problem here is that there are no such methods natively, so we will have to proably use setTimeout, but I think it's better to discuss this issue
It was added in #57901 with the assumption that the list onLayout will trigger everytime a new item is added to the list. However, in our case, after adding the attachment, the onLayout isn't triggered, so isScrollToBottomEnabled stays true, and when editing the message, the onLayout is triggered, and because isScrollToBottomEnabled is true, the scroll to bottom happens.
Invoked on mount and on layout changes.
From the React docs, onLayout is triggered only on mount and layout changes. The onLayout is triggered when we edit a message because the main composer hides, causing the list position to change. We can't rely on this to check if a new item is added or not.
What changes do you think we should make in order to solve the problem?
The issue that #57901 is trying to solve only happens on iOS Chrome. I can't test it there, but if it's not happening anymore, then we can simply revert it. Otherwise,
we can use a more reliable approach by using onContentSizeChange instead of onLayout.
onContentSizeChange={() => {
if (isScrollToBottomEnabled) {
reportScrollManager.scrollToBottom();
setIsScrollToBottomEnabled(false);
}
}}
(we can consider changing isScrollToBottomEnabled to a ref to avoid unnecessary render)
note that I can't test this on iOS Chrome, so I need the C+ to verify this.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
changed the title [-]mweb/Chrome - Chat - Edit message after sending attachment, composer box isn't fit on screen[/-][+][$250] mweb/Chrome - Chat - Edit message after sending attachment, composer box isn't fit on screen[/+]on Jul 4, 2025
I agree with @s77rt opinion here that the root cause for #57379 was not correct and we should revert that PR then find the correct root cause for it instead. Reseting that state in some specific cases seems like a workaround. Still looking for a proposal with correct RCA.
@dominictb Yes, we can revert the isScrollToBottomEnabled flag and use requestAnimationFrame(() => { reportScrollManager.scrollToBottom(); }); to trigger the scroll action in the next available frame, specifically for Safari.
Activity
melvin-bot commentedon Jul 2, 2025
Triggered auto assignment to @lydiabarclay (
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.Eskalifer1 commentedon Jul 2, 2025
I think the reason for the bug is that we currently don't have the scroll to element with composer focus working correctly
2025-07-03.00.36.45.mov
Here are one of the two: Either it's a regression from some change that was overlooked or it's after some library was updated, because a task was created for this earlier and that part of the code is still here:
App/src/pages/home/report/ReportActionItemMessageEdit.tsx
Lines 478 to 480 in 98503fe
This is the PR: #56079
As you can see from the screenshots, it worked at that moment
In general, as for me, the main problem here is that on Android mweb the keyboard appears almost instantly when the field is focused. This is the default behavior and we probably can't override it. If you compare it with other environments, you can see that the scroll happens first, and only then the keyboard appears.
Therefore, it would be possible to scroll for isMobileChrome after the keyboard appears, but the problem here is that there are no such methods natively, so we will have to proably use setTimeout, but I think it's better to discuss this issue
bernhardoj commentedon Jul 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The edit message out of screen a bit when editing it after adding an attachment.
What is the root cause of that problem?
When we edit the message, a scroll to bottom is called because the list onLayout is triggered and
isScrollToBottomEnabledis true.App/src/pages/home/report/ReportActionsList.tsx
Lines 633 to 639 in 9e3b5bd
isScrollToBottomEnabledis true when there is a new action and we want to scroll to bottom.App/src/pages/home/report/ReportActionsList.tsx
Line 431 in 9e3b5bd
It was added in #57901 with the assumption that the list
onLayoutwill trigger everytime a new item is added to the list. However, in our case, after adding the attachment, theonLayoutisn't triggered, soisScrollToBottomEnabledstays true, and when editing the message, theonLayoutis triggered, and becauseisScrollToBottomEnabledis true, the scroll to bottom happens.From the React docs, onLayout is triggered only on mount and layout changes. The onLayout is triggered when we edit a message because the main composer hides, causing the list position to change. We can't rely on this to check if a new item is added or not.
What changes do you think we should make in order to solve the problem?
The issue that #57901 is trying to solve only happens on iOS Chrome. I can't test it there, but if it's not happening anymore, then we can simply revert it. Otherwise,
we can use a more reliable approach by using
onContentSizeChangeinstead ofonLayout.(we can consider changing
isScrollToBottomEnabledto a ref to avoid unnecessary render)note that I can't test this on iOS Chrome, so I need the C+ to verify this.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
dmkt9 commentedon Jul 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Depend on size of attachment, edit composer is cut off by the header
What is the root cause of that problem?
isScrollToBottomEnabledis set totrueby:App/src/pages/home/report/ReportActionsList.tsx
Line 431 in 9e3b5bd
App/src/pages/home/report/ReportActionsList.tsx
Lines 633 to 642 in 9e3b5bd
Since
isScrollToBottomEnabled === true, the chat view scrolls to the bottom.What changes do you think we should make in order to solve the problem?
Ensure that scrolling to the bottom is not triggered when the composer is focused during an edit:
App/src/pages/home/report/ReportActionsList.tsx
Line 636 in 9e3b5bd
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
[-]mweb/Chrome - Chat - Edit message after sending attachment, composer box isn't fit on screen[/-][+][$250] mweb/Chrome - Chat - Edit message after sending attachment, composer box isn't fit on screen[/+]melvin-bot commentedon Jul 4, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021940993162951905956
melvin-bot commentedon Jul 4, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)ikevin127 commentedon Jul 5, 2025
108 remaining items
dominictb commentedon Sep 3, 2025
I'm still catching up with context on this one.
dominictb commentedon Sep 3, 2025
I agree with @s77rt opinion here that the root cause for #57379 was not correct and we should revert that PR then find the correct root cause for it instead. Reseting that state in some specific cases seems like a workaround. Still looking for a proposal with correct RCA.
huult commentedon Sep 4, 2025
@dominictb Yes, we can revert the
isScrollToBottomEnabledflag and userequestAnimationFrame(() => { reportScrollManager.scrollToBottom(); });to trigger the scroll action in the next available frame, specifically for Safari.App/src/pages/home/report/ReportActionsList.tsx
Line 458 in 8ebed90
update to:
requestAnimationFrame(() => { reportScrollManager.scrollToBottom(); });Screen.Recording.2025-09-04.at.08.32.20.mov
melvin-bot commentedon Sep 5, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
mvtglobally commentedon Sep 5, 2025
Issue not reproducible during KI retests. (Second week)
melvin-bot commentedon Sep 8, 2025
@dominictb Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Sep 12, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Sep 12, 2025
@dominictb 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
mvtglobally commentedon Sep 13, 2025
Issue not reproducible during KI retests. (Third week)
lydiabarclay commentedon Sep 15, 2025
Hey @dominictb QA was unable to reproduce over the course of three weeks of re-tests. I'm going to go ahead and close this.