-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 payment 2023-11-30] [$500] Cursor position is stuck after emoji on copy pasting text with emoji text in it #29795
Comments
Triggered auto assignment to @CortneyOfstad ( |
Job added to Upwork: https://www.upwork.com/jobs/~01d23deb324334bf75 |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Cursor position is stuck after emoji on copy pasting text with emoji text in it What is the root cause of that problem?Our text input works like this: What changes do you think we should make in order to solve the problem?Since, unfortunately, we do not have native support We can try to do it differently We can update this code App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js Lines 226 to 237 in c498ab5
Like
As an alternative Clipboard.getString we can use useClipboard What alternative solutions did you explore? (Optional)Also, we can try to use with which we can get information about the entered text which matches the last characters entered And if the Because if we just write text And if we have more than one character we will use the same logic as in original proposition As a result we can update this line like
Optional We can take some of the logic from the original proposition and add
This like
And setSelection like
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js Lines 233 to 236 in c498ab5
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Cursor position is stuck after emoji on copy pasting text with emoji text in it What is the root cause of that problem?When users paste the text to composer, we're running the following code App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js Lines 231 to 236 in 9d79fd1
we set commentValue = -> remainder = 5 -> the selection always is after emoji What changes do you think we should make in order to solve the problem?We should not use the remainder here. When users change the input value, we should calculate the actual length change and use this value to update selection
ResultScreen.Recording.2023-10-18.at.16.14.59.mov |
@Ollyws any thoughts on the proposals above? TIA! |
I am heading OoO until Oct. 25 so reassigning BZ to keep an eye on this while I am gone 👍 |
Triggered auto assignment to @johncschuster ( |
@Ollyws, what are your thoughts on the proposals above? |
Thanks for the proposals everyone. @ZhenjaHorbach So what you're saying is there is no way we can listen for paste events, correct? The problem I can see with your proposal is that if a user were to type the same text as is on their clipboard |
Yes, unfortunately, I haven’t found an adequate way to catch paste events for text input We have Something more or less suitable for the web But for mobile apps i can't find But yes, the disadvantage of my proposal is that there are rare cases when the current text may be the same as the text stored on the clipboard But I add alternative proposition |
Still open for more proposals on this one... |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Will have a look at this one today. |
I like @barros001's general approach and it seems to resolve all of the issues we previously mentioned. There is one small issue where if you paste So let's go with @barros001's proposal. 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@Ollyws thanks for reviewing my proposal.
I just tested this scenario and it works as expected, see video below. Maybe this got fixed along the way as I was working on the proposal. But as you said, any issues that arises we'll iron out in the PR. Screen.Recording.2023-11-13.at.10.43.14.AM.mov |
📣 @Ollyws 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @barros001 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
PR up for review. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.2-3 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 2023-11-30. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on 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:
|
BugZero Checklist:
I don't think we can say this is a regression from any PR, It was just only considered that when converting an emoji the cursor should be placed after the emoji regardles if it was typed or pasted.
N/A
N/A
I don't think a regression test is necessary as we added numerous unit tests that should catch any unwanted changes to the intended behaviour. |
@dhanashree-sawant, @Ollyws @barros001 — all have been paid via Upwork and no regression test required, so closing! Thanks all! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.3.85-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: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697546821680559
Action Performed:
Expected Result:
App should display cursor at the end of text when we paste any text
Actual Result:
App displays cursor after emoji even when we paste text with emoji text in middle and not in end
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android.native.emoji.cursor.position.issue.mp4
Android: mWeb Chrome
Android.chrome.wrong.cursor.position.issue.emoji.mp4
iOS: Native
ios.native.cursor.postion.issue.emoji.mov
iOS: mWeb Safari
ios.safari.cursor.postion.issue.emoji.mov
MacOS: Chrome / Safari
Recording.109.mp4
windows.chrome.cursor.postion.emoji.issue.mp4
MacOS: Desktop
mac.desktop.cursor.position.wrong.emoji.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: