-
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
[hold for app #12854] [$2000] Shows incorrect emoji while combining the manual and emoji picker selected emoji within the text #13066
Comments
Triggered auto assignment to @joekaufmanexpensify ( |
Proposal As we are removing the character between the emoji string(: smile:) I think prevState selection logic won't work in the following code. App/src/pages/home/report/ReportActionCompose.js Lines 392 to 396 in 17c34e3
The above solution will fix 12325 too which was earlier fixed with prevState selection logic. |
Proposaldiff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js
index 2335864f91..fc7b5fad51 100644
--- a/src/pages/home/report/ReportActionCompose.js
+++ b/src/pages/home/report/ReportActionCompose.js
@@ -7,6 +7,7 @@ import {
} from 'react-native';
import _ from 'underscore';
import lodashGet from 'lodash/get';
+import lodashClamp from 'lodash/clamp';
import {withOnyx} from 'react-native-onyx';
import lodashIntersection from 'lodash/intersection';
import styles from '../../../styles/styles';
@@ -389,10 +390,11 @@ class ReportActionCompose extends React.Component {
value: newComment,
};
if (comment !== newComment) {
- const remainder = prevState.value.slice(prevState.selection.end).length;
+ const offset = newComment.length - comment.length;
+ const compensation = Math.max(comment.length - prevState.value.length, 0);
newState.selection = {
- start: newComment.length - remainder,
- end: newComment.length - remainder,
+ start: lodashClamp(prevState.selection.start + offset + compensation, 0, newComment.length),
+ end: lodashClamp(prevState.selection.end + offset + compensation, 0, newComment.length),
};
}
return newState; Details:The current implemented code does not take into account |
Triaging this now: From this SO: https://stackoverflow.com/c/expensify/questions/14418
|
I can reproduce this on web. Added some more detail to reproduction steps. This is a niche bug, however it can be reproduced, so I think we proceed with fixing it. |
My thinking is this should be external. Assigning to engineering to confirm! |
Triggered auto assignment to @johnmlee101 ( |
Yep, confirmed. At first I thought it was the skin-tone modifiers for emoji but it seems to be injecting it in a way that splits the unicode incorrectly. |
Current assignee @joekaufmanexpensify is eligible for the External assigner, not assigning anyone new. |
Job added to Upwork: https://www.upwork.com/jobs/~016d120322c0f448f0 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Current assignee @johnmlee101 is eligible for the External assigner, not assigning anyone new. |
Initial proposal screencast ff99a282-339f-4945-b1b8-6bbed6009d52.webm |
@johnmlee101 @joekaufmanexpensify, I won't be able to get to this today. Please re-assign. |
Current assignee @joekaufmanexpensify is eligible for the External assigner, not assigning anyone new. |
This comment was marked as outdated.
This comment was marked as outdated.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Same |
Still on hold. |
Same |
Hey, #12854 has been first put on hold for a now closed and dismissed PR. Afterwards it has been put on hold for another PR, but this PR is only addressing an android issue. So I'd say this issue can be taken off hold, and we can again look into proposals! |
Sounds good! @johnmlee101 and @sobitneupane does that sound good to y'all as well? |
The issue right now is on hold for another issue that fixes a bug on android, while this issue is a web issue. They are in that sense not related. For iOS there is this issue: I confirmed that the issue will be fixed once we upgrade the app to fabric renderer. |
@johnmlee101 curious what you think here? |
As long as both issues don't overlap or conflict with each other, I think we can remove off HOLD. |
This issue exists on all platform not only Web. And to confirm the solution works well, the selection issues on IOS and android should be handled first. |
Got it. @sobitneupane that would mean in fact leaving this on hold until 12854 is done. Is that right? |
Still waiting for confirmation |
@joekaufmanexpensify yes. |
Got it, ty! |
Still on hold |
Same |
Still on hold |
Same |
Same. |
Held |
Same |
1 similar comment
Same |
Same. |
Same |
Held |
Just retested this and its no longer reproducible. Closing. |
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:
Te:smile :st
in the text bar.Expected Result:
Should show both emoji adjacently after selecting the second one.
Actual Result:
Shows a weird emoji, and removes the original emoji, incorrectly.
Workaround:
Select emojis via the emoji picker.
Platform:
Where is this issue occurring?
Version Number: v1.2.32-1
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
7c67d298-274a-4ea8-a781-e28384f08007.webm
https://user-images.githubusercontent.com/43996225/204145304-bf1f2078-3b3f-46c5-9ac0-26b4d8bcf01e.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Pujan92
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1669391872652859
View all open jobs on GitHub
Recording.1012.mp4
Upwork Automation - Do Not Edit
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: