-
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
Fixed problem with cursor jumping back to start when adding an emoji in edit mode #31611
Conversation
Co-authored-by: Fábio Henriques <fabio.lacerda@outlook.com>
@abdulrahuman5196 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] |
@artus9033 Doesn't it seem like the cursor is jumping to starting point(like {0,0}) and re-jumping again to the current cursor place? |
Indeed @abdulrahuman5196 you're right, it seems like there is a momentary unwanted behaviour - thanks for the notification. I will modify the approach to evade this problem and ping you when it is ready for review. |
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.
Left comments.
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.
@abdulrahuman5196 the PR is ready for review now. |
@abdulrahuman5196 kind reminder for review 👀 |
The new changes in the PR, mostly feels like we are doing lots of platform related workaround fixes to solve this minor issue. What do you think @neil-marcellini |
@abdulrahuman5196 @neil-marcellini kindly bump 😄 |
@abdulrahuman5196 kindly bump |
Hi. Gentle ping on @neil-marcellini |
@sakluger I think Neil is off till Jan 15th, can we involve any other engineer for this? |
@abdulrahuman5196 @neil-marcellini kindly bump! :D |
@neil-marcellini Any update on this? |
Hey @abdulrahuman5196 could we close this PR and I will reopen a new one? Artur isnt working in the project so it would be easier for me to update everything |
Thanks for the ping. @neil-marcellini Could you kindly provide direction here? #31611 (comment) |
👀 taking a look |
Yes I agree. Per our guidelines, using |
@MrRefactor sure thing. I'll close this and re-assign you to the issue, and you can open a new PR. |
Details
In the chrome browser on Android devices when the user edits the message and chooses an emoji from the emoji modal, the cursor jumps back at the beginning of the input. The problem is that
addEmojiToTextbox
is called fromEmojiPickerButton
component'sonEmojiSelected
callback prop, which is called just beforeonModalHide
. The former in turn callsfocusComposerWithDelay
, which callsfocus()
on the text input. That method is annotated with the commend 'The exact behavior triggered will depend on the platform and type of view.', which apparently on Android mWeb Chrome moves the cursor to the start and is the root cause of the problem in this issue. Adding an additional parameter to this function to force-set the position to the state-carried one on this platform fixes the problem and even - when applied - renders the original proposal solution unnecessary.Fixed Issues
$ #28563
PROPOSAL:
#28563 (comment)
Tests
Offline tests
Same as Tests
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 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)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
Screen.Recording.2023-11-27.at.14.40.08.mov
Android: mWeb Chrome
Screen.Recording.2023-11-27.at.14.42.04.mov
iOS: Native
Screen.Recording.2023-11-27.at.14.49.03.mov
iOS: mWeb Safari
Screen.Recording.2023-11-27.at.16.00.55.mov
MacOS: Chrome / Safari
Screen.Recording.2023-11-27.at.16.04.58.mov
Screen.Recording.2023-11-27.at.16.05.46.mov
MacOS: Desktop
Screen.Recording.2023-11-27.at.16.19.34.mov