-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix the cursor moves one space backward when inserting text after an emoji #42985
Changes from 1 commit
998859d
65be697
bf75e33
99d401e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -406,6 +406,9 @@ function ComposerWithSuggestions( | |||||||
*/ | ||||||||
const updateComment = useCallback( | ||||||||
(commentValue: string, shouldDebounceSaveComment?: boolean) => { | ||||||||
if (isIOSNative) { | ||||||||
syncSelectionWithOnChangeTextRef.current = null; | ||||||||
} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or should we remove App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 442 to 444 in 2514f29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we remove it, #29405 will happen again. |
||||||||
raiseIsScrollLikelyLayoutTriggered(); | ||||||||
const {startIndex, endIndex, diff} = findNewlyAddedChars(lastTextRef.current, commentValue); | ||||||||
const isEmojiInserted = diff.length && endIndex > startIndex && diff.trim() === diff && EmojiUtils.containsOnlyEmojis(diff); | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 442 to 444 in 2514f29
I think your main solution to add additional here should work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main solution is actually to use it here, but this breaks on other platforms.
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Line 438 in 24c5fe2
That works too though. Which one do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding additional check here is better
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Line 441 in 24c5fe2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!