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 for payment 2024-06-20] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji #42664
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: v1.4.76-1 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/4577924 Issue reported by: Applause - Internal Team
Action Performed:
Pre-requisite: the user must be logged in.
Go to any chat.
Tap on the compose box.
Enter any text and an emoji.
After you have entered the emoji, enter any character again.
Verify the cursor moves one space backward.
Expected Result:
The cursor should remain at the end of the compose box content.
Actual Result:
The cursor moves one space backward when inserting text after an emoji.
Workaround:
n/a
Platforms:
Which of our officially supported platforms is this issue occurring on?
@kadiealexander FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.
changed the title [-]iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/-][+][$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/+]on May 28, 2024
commentValue is the text that we type while the newComment is the commentValue that has emoji code replaced to emoji character (for example :smile: to 😄).
If they are different, we want to manually correct the selection, however, on iOS, the selection prop is buggy so we use the ref sync solution that imperatively updates the selection that is introduced in #30835.
It will update/sync the selection in onChangeText.
First, when we add an emoji from the emoji picker, commentValue is not equal to newComment even though there is no emoji code converted to an emoji character. The reason behind this is that we add a whitespace to the text
So, commentValue doesn't have the whitespace while the newComment has the whitespace. Previously, commentValue already contained the whitespace every time we added an emoji from the emoji picker, but this PR changes it so the whitespace is also added when we add the emoji from the device keyboard emoji picker.
This will then set the selection to the ref (syncSelectionWithOnChangeTextRef).
Next, if we add an emoji from the emoji picker, onChangeText won't be triggered. onChangeText will only be triggered if we input the text manually from keyboard.
So, when we add a character, it will run the selection sync logic which contains the old selection.
What changes do you think we should make in order to solve the problem?
We need to compare newComment with the commentValue with whitespace appended because the manual selection correction is only used when we add emoji through emoji code.
changed the title [-][HOLD for payment 2024-06-18] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/-][+][HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/+]on Jun 13, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
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:
[@eh2077] 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: NA
[@eh2077] Determine if we should create a regression test for this bug. Yes, if only there isn't such one already added
[@eh2077] 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.
changed the title [-][HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/-][+][HOLD for payment 2024-06-20] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/+]on Jun 14, 2024
[@eh2077] 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: NA
[@eh2077] Determine if we should create a regression test for this bug. Yes, if only there isn't such one already added
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon May 27, 2024
Triggered auto assignment to @kadiealexander (
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.kbecciv commentedon May 27, 2024
We think that this bug might be related to #vip-vsb
kbecciv commentedon May 27, 2024
@kadiealexander FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.
[-]iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/-][+][$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/+]melvin-bot commentedon May 28, 2024
Job added to Upwork: https://www.upwork.com/jobs/~011bc1604b6420e233
melvin-bot commentedon May 28, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (
External)bernhardoj commentedon May 28, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The cursor selection moves to the left by one character when adding a character after inserting an emoji.
What is the root cause of that problem?
When we add a text to the composer, it will save the new selection position to a ref if the
commentValueis not equal tonewCommentApp/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 439 to 444 in 2514f29
commentValueis the text that we type while thenewCommentis thecommentValuethat has emoji code replaced to emoji character (for example:smile:to 😄).If they are different, we want to manually correct the selection, however, on iOS, the selection prop is buggy so we use the ref sync solution that imperatively updates the selection that is introduced in #30835.
It will update/sync the selection in
onChangeText.App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 553 to 563 in 2514f29
However, there are a few things to notice here.
First, when we add an emoji from the emoji picker,
commentValueis not equal tonewCommenteven though there is no emoji code converted to an emoji character. The reason behind this is that we add a whitespace to the textApp/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Line 417 in 2514f29
So,
commentValuedoesn't have the whitespace while thenewCommenthas the whitespace. Previously,commentValuealready contained the whitespace every time we added an emoji from the emoji picker, but this PR changes it so the whitespace is also added when we add the emoji from the device keyboard emoji picker.This will then set the selection to the ref (syncSelectionWithOnChangeTextRef).
Next, if we add an emoji from the emoji picker,
onChangeTextwon't be triggered.onChangeTextwill only be triggered if we input the text manually from keyboard.So, when we add a character, it will run the selection sync logic which contains the old selection.
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 553 to 563 in 2514f29
What changes do you think we should make in order to solve the problem?
We need to compare
newCommentwith thecommentValuewith whitespace appended because the manual selection correction is only used when we add emoji through emoji code.What alternative solutions did you explore? (Optional)
Clear the ref every time we call
updateComment. This is to invalidate any old selection sync ref.App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 408 to 411 in 2514f29
22 remaining items
melvin-bot commentedon Jun 11, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".[-][HOLD for payment 2024-06-18] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/-][+][HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/+]melvin-bot commentedon Jun 13, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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 2024-06-20. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 13, 2024
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:
[-][HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/-][+][HOLD for payment 2024-06-20] [$250] iOS - Chat - The cursor moves one space backward when inserting text after an emoji[/+]eh2077 commentedon Jun 15, 2024
Checklist
Regression test
Do we agree 👍 or 👎
kadiealexander commentedon Jun 19, 2024
Payouts due: