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
[HOLD #27977][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box #35369
Version Number: v1.4.33-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:
Action Performed:
Pre-requisite: user must be logged in.
Go to any chat.
Tap on the compose box.
Tap on Enter until you have entered more than 6 lines.
Expected Result:
The cursor should be displayed no matter how many lines are being entered.
Actual Result:
The cursor disappears after more than 6 lines have been entered.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-][+][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+]on Jan 30, 2024
📣 @rayanetech! 📣
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:
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.
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.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Please re-state the problem that we are trying to solve in this issue.
Cursor goes out of view after adding more than 6 lines
What is the root cause of that problem?
For small screen devices, the max number of lines for Composer input is set to 6 lines. On mobile safari beyond this height overflow scroll behaviour sets in. So even though the scroll height of TextArea increases the visible area of the TextArea is limited to 6 lines. So cursor moves beyond the visible area when new line is entered beyond 6 lines. That's the reason cursor gets hidden.
However when user enters any other character the scroll position is reset to the cursor position making the cursor visible again.
What changes do you think we should make in order to solve the problem?
The scroll position of the Composer TextArea should be set to the cursor position at all times, even when the character entered is a new line. To acheive this we already have a hook updateMultilineInputRange that sets scrollTop to current scroll height of input. But for ComposerWithSuggestion it gets invoked only on mount as the dependency array of useEffect hook is set to [].
Instead add value to dependency array so that the scroll position is set whenever value changes. This ensures that scroll position is maintained even when new line is entered.
useEffect(()=>{// Scrolls the composer to the bottom and sets the selection to the end, so that longer drafts are easier to editupdateMultilineInputRange(textInputRef.current,shouldAutoFocus);if(value.length===0){return;}Report.setReportWithDraft(reportID,true);// Add value as a dependency so that the hook runs on value change// eslint-disable-next-line react-hooks/exhaustive-deps},[value]);
Result
Before
After
before.mp4
fix.mp4
What alternative solutions did you explore? (Optional)
changed the title [-][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-][+][HOLD][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+]on Feb 8, 2024
changed the title [-][HOLD][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-][+][HOLD #27977][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+]on Feb 12, 2024
Activity
[-]Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-][+][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+]melvin-bot commentedon Jan 30, 2024
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 30, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01dd5527568c5f7f46
melvin-bot commentedon Jan 30, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)melvin-bot commentedon Jan 30, 2024
📣 @rayanetech! 📣
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:
Format:
aswin-s commentedon Jan 31, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Cursor goes out of view after adding more than 6 lines
What is the root cause of that problem?
For small screen devices, the max number of lines for Composer input is set to 6 lines. On mobile safari beyond this height overflow scroll behaviour sets in. So even though the scroll height of TextArea increases the visible area of the TextArea is limited to 6 lines. So cursor moves beyond the visible area when new line is entered beyond 6 lines. That's the reason cursor gets hidden.
However when user enters any other character the scroll position is reset to the cursor position making the cursor visible again.
What changes do you think we should make in order to solve the problem?
The scroll position of the Composer TextArea should be set to the cursor position at all times, even when the character entered is a new line. To acheive this we already have a hook
updateMultilineInputRangethat sets scrollTop to current scroll height of input. But for ComposerWithSuggestion it gets invoked only on mount as the dependency array of useEffect hook is set to[].App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Lines 544 to 555 in 4e88eea
Instead add
valueto dependency array so that the scroll position is set whenever value changes. This ensures that scroll position is maintained even when new line is entered.Result
before.mp4
fix.mp4
What alternative solutions did you explore? (Optional)
None
melvin-bot commentedon Feb 2, 2024
@garrettmknight, @mananjadhav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
mananjadhav commentedon Feb 2, 2024
@aswin-s's proposal seems to be working. I can see both the videos are iOS native, @aswin-s but the header says
Webon the right.🎀 👀 🎀 C+ Reviewed.
13 remaining items
[-][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-][+][HOLD][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+]mananjadhav commentedon Feb 8, 2024
@danieldoglas @thienlnam Do we have any PR or issue that we can link against?
danieldoglas commentedon Feb 8, 2024
The web implementation was merged yesterday in the react-live-markdown repo Expensify/react-native-live-markdown#32, and it looks like it's making it's way to web here #35837
thienlnam commentedon Feb 8, 2024
Live markdown web has been merged!
mananjadhav commentedon Feb 12, 2024
@kavimuru Is this still reproducible?
thienlnam commentedon Feb 12, 2024
We actually ended up reverted the PR, but I'm going to update the issue it's held on so we can wait until then
[-][HOLD][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/-][+][HOLD #27977][$500] Chat - Cursor is not displayed after 6 lines have been entered in compose box[/+]danieldoglas commentedon Feb 20, 2024
still on hold
garrettmknight commentedon Feb 28, 2024
Still holding on #279877
garrettmknight commentedon Mar 5, 2024
Looks like it's fixed, closing!