-
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 29405 cursor displayed before emoji on ios native #30835
Conversation
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Please fix conflict |
@artus9033 can you please continue this PR? Just fix conflict |
Sure! @aimane-chnaif please feel free to review, conflict resolved. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@artus9033 please check this video. When there's text next to emoji, not working. (iOS only) ios.bug.mov |
Thank you @aimane-chnaif, I can also reproduce that. At the moment it seems to me that there is a problem with React Native's |
Update: seems like there are a few problems with |
Update: still developing an approach to address that |
… emoji for marker
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Outdated
Show resolved
Hide resolved
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Show resolved
Hide resolved
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Outdated
Show resolved
Hide resolved
@aimane-chnaif the PR is ready for review and below you can find a few words explaining my latest changes. The previous fix involved a momentary behaviour of the cursor jumping to For the reason described above, I decided that it will be better to drop the controlled approach in favor of using an existing ref to set a flag to sync cursor position inside |
Was there an attempt to fix in iOS native code? |
No, not tried. I checked issues and SO, where there were reports of such problems, but none resolved so far. Do we want to go in this direction? |
It would be ideal. |
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Outdated
Show resolved
Hide resolved
Just a quick notice, I'm OOO until Wednesday - I'll report back then. |
Absolutely, posting the new proposal on main issue. Regarding the native code, I inspected it today but couldn't find the root cause of the issue there. Can we carry on with the non-native solution? |
(commentValue) => { | ||
updateComment(commentValue, true); | ||
|
||
if (isIOSNative && syncSelectionWithOnChangeTextRef.current) { |
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.
isIOSNative &&
may be redundant as syncSelectionWithOnChangeTextRef.current
will never be set in all other platforms
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.
Absolutely, this is true - however, since this has negligent impact on performance, I wanted it to stay there as a defensive condition for the code to be clean & stable. Please consider a situation when something that sets this ref is introduced in the future, in which case this condition would still prevent the code from being executed and also it explicitly shows that this is only to be set on iOS native. Would you agree to leave this here, then?
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.
ok leave it then
const positionSnapshot = syncSelectionWithOnChangeTextRef.current.position; | ||
syncSelectionWithOnChangeTextRef.current = null; | ||
|
||
InteractionManager.runAfterInteractions(() => { |
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.
please add comment why InteractionManager.runAfterInteractions
is needed
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.
Do you mean in code? It is required to ensure that the selection is set imperatively after all state changes are effective; without it, the problem would still persist since setSelection
would run too eager.
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.
Do you mean in code?
yes, please as InteractionManager.runAfterInteractions
is workaround solution
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.
Sure thing. Resolved in 98436b7
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
@youssef-lr all yours! (please check #29405 (comment))
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 staging by https://github.com/youssef-lr in version: 1.4.19-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.19-2 🚀
|
Details
In the native iOS application if the user types the emoji manually, but they unintentionally put a space after the first colon mark (e.g. “: joy:”) and then remove the space, the emoji is converted successfully, but the cursor goes before the emoji instead of after the emoji.
Fixed Issues
$ #29405
PROPOSAL: #29405 (comment)
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
29405android.mp4
Android: mWeb Chrome
29405androidWeb.mp4
iOS: Native
29405ios.mp4
iOS: mWeb Safari
29405iosWeb.mp4
MacOS: Chrome / Safari
29405web.mp4
MacOS: Desktop
29405desktop.mp4