-
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
[$500] Chat - Unable to remove emoji after inserting emoji using undo shortcut #31712
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01c8ca033c48a35540 |
Triggered auto assignment to @sakluger ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Unable to remove emoji after inserting emoji using undo shortcut What is the root cause of that problem?By default input history is managed by the browser, it only keeps history when a user interacts by typing on an input field. in this case, the value state passes to input the same with history value so we still can use undo, redo feature. But when we update the value is different from the input history value then the current history on the input field will be reset and that is a native behavior. What changes do you think we should make in order to solve the problem?We can manually i have implemented this hook at this file Then using this hook at Composer ......
useInputHistory({
value,
textInput,
onChangeText: props.onChangeText,
});
return (
)
.... POC 31712.mp4What alternative solutions did you explore? (Optional)We can use onEmojiSelected={(emoji) => {
ReportActionComposeFocusManager.focus();
document.execCommand('insertText', false, `${emoji} `);
}} We have 3 cases that need to be updated typing, select from picker and select from suggestion so we will create a function insertEmoji inside |
@suneox Thanks for the proposal. I don't think your RCA is correct / complete. If we are updating the text without updating the history then I'd expect the undo action to skip a step and keep working. Also what about the case where the emoji is typed (and not selected from the picker)? |
I have missed information for this case, To handle this case we will create a function After that we will update using at insertSelectedEmoji function, also update at onEmojiSelected function |
@suneox Can you please elaborate your RCA first? How exactly is the history lost? |
By default input history is managed by the browser, it only keeps history when a user interacts by typing on an input field. in this case, the value state passes to input the same with history value so we still can use undo, redo feature. But when we update the value is different from the input history value then the current history on the input field will be reset and that is a native behavior. |
@suneox Please see https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand. |
Yes I know but |
Yes we have 3 cases need to update include typing, select from picker and select from suggestion, I'll update detail asap |
Hi @s77rt I have updated my proposal and I have moved the alternative solution to the primary solution, due to |
@suneox Thanks for the update. I think the history approach is an overkill for a bug that is browser limitation related. |
sure I'll update ASAP but i'd like to confirm a proposal has using some |
The proposal will be reviewed by an internal engineer and can be escalated to a Slack thread for more engineers review. It could be rejected, although we already use it in our codebase this is not a strong argument to use it on other places. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@s77rt Due to execCommand solution can be rejected so should we go a head using history hook? and Could you please try the hook on my proposal? |
@suneox I think we should try explore more solutions. The history approach looks an overkill here and I'd prefer to avoid it. |
@s77rt I'd like to inform the alternative solution for the feature |
@suneox I would really prefer to avoid the history approach. Also please note that the solution should be explained in plain English without code diff, PRs, etc. (you can use pseudo code though) |
Not close Melvin. This is arguably a browser limitation/design. Still looking for proposals |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Hi @s77rt @sakluger, I think in the future this approach is better and currently I have implemented it for this issue we can handle If we don't want to apply the history management approach, I think we can only choose a solution using |
Not overdue. Still discussing on slack |
Coming from the Slack thread, this is a minor issue with a simple workaround and hard/ hacky fix so I am going to close this out |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v1.4.2-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:
Expected Result:
The emoji will be removed.
Actual Result:
The emoji cannot be removed using undo shortcut.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6287178_1700659510506.20231122_191947.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: