-
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
Fix the cursor moves one space backward when inserting text after an emoji #42985
Fix the cursor moves one space backward when inserting text after an emoji #42985
Conversation
if (isIOSNative) { | ||
syncSelectionWithOnChangeTextRef.current = null; | ||
} |
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
if (isIOSNative) { | |
syncSelectionWithOnChangeTextRef.current = {position, value: newComment}; | |
} |
I think your main solution to add additional here should work, right?
if (commentWithSpaceInserted !== newComment && isIOSNative) {
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
if (commentValue !== newComment) { |
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
if (isIOSNative) { |
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!
if (isIOSNative) { | ||
syncSelectionWithOnChangeTextRef.current = null; | ||
} |
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.
Or should we remove
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 442 to 444 in 2514f29
if (isIOSNative) { | |
syncSelectionWithOnChangeTextRef.current = {position, value: newComment}; | |
} |
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.
If we remove it, #29405 will happen again.
…match the converted comment with space inserted
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemobile-chrome.moviOS: Nativeios.moviOS: mWeb Safarimobile-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
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.
LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.81-11 🚀
|
Details
The selection/cursor moves one character when adding a character after an emoji.
Fixed Issues
$ #42664
PROPOSAL: #42664 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-06-03.at.19.35.22.mov
Android: mWeb Chrome
Screen.Recording.2024-06-03.at.19.25.14.mov
iOS: Native
Screen.Recording.2024-06-03.at.19.11.53.mov
iOS: mWeb Safari
Screen.Recording.2024-06-03.at.19.18.53.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-03.at.19.17.55.mov
MacOS: Desktop
Screen.Recording.2024-06-03.at.19.18.19.mov