-
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
Caret position on WEB #17331
Caret position on WEB #17331
Conversation
…if `shouldCalculateCaretPosition` is true
…eb-caret-position
@hayata-suenaga 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] |
@perunt could you paste the link to the issue on your comment next to |
@puneetlath since you have the context, if you have time, could you also review this PR? |
Yes, I'll take a look! |
…into perunt/web-caret-position
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.
Looks good to me.
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!
Unchecked:
Updated:
New:
|
@0xmiroslav thanks for letting me know about the missed and new checkbox! Right now, it only works with the main input, but it can be easily transferred to the edit input soon. |
@perunt so is your plan to do that in a separate PR? |
Splitting this PR and merging the one in question would help me save time, enabling me to work on the Emoji Suggestion task simultaneously. So yeah, if you don't mind, I would love to split it. |
Ok sounds good. @0xmiroslav will you be able to complete the checklist today? |
reviewing in an hr |
@@ -192,6 +201,57 @@ class Composer extends React.Component { | |||
this.textInput.removeEventListener('wheel', this.handleWheel); | |||
} | |||
|
|||
// Get characters from the cursor to the next space or new line | |||
getNextChars(str, cursorPos) { |
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.
need jsDoc for params
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - ChromeMobile Web - Safarimsafari.movDesktopdesktop.moviOSN/A AndroidN/A |
Web, desktop, mSafari look good but android chrome failing mchrome.mov |
This PR doesn't handle the scrolling and height restriction for the text input. Right now, it works fine until you reach the scroll in the input field. The same issue would occur on other platforms too. I'm not sure if we face the same problem in the native environment. If we do, it would make sense to create a separate PR and synchronize it across all platforms. If not, then it would be better to include it in this PR. |
@puneetlath what do you suggest? |
Sounds like we need to figure out whether it's also a problem on native devices in order to decide. |
@perunt is that a question that you're going to investigate? |
@puneetlath absolutely! I'll definitely check it out and make sure to mention you. I apologize for the delay as I've had to prioritize a more urgent task. I'll make sure to get to it sometime during the day. |
No worries! Just making sure. |
@perunt did you have a chance to investigate the problem? |
i just checked it , and it works the same on Android and IOS May-22-2023.20-31-30.mp4May-22-2023.20-15-55.mp4 |
@hayata-suenaga @puneetlath what do you think, can we handle this measuring and connect all platforms in the separate PR? |
That works for me. @hayata-suenaga @0xmiroslav good with you? |
I am good. Happy to review that follow-up PR as well 🙂 |
Ok cool. @0xmiroslav The reviewer checklist check is failing for some reason. |
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.
🚀
✋ 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/puneetlath in version: 1.3.18-0 🚀
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.18-0 🚀
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.18-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.18-2 🚀
|
<View | ||
style={{ | ||
position: 'absolute', | ||
bottom: -2000, |
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.
this changes made a regression - #26535
Details
Fixed Issues
$ #16078
PROPOSAL: GH_LINK_ISSUE(COMMENT)
This PR adds caret tracking for web and desktop platforms, which is an essential step in bringing inline suggestions to the text input
In this pull request, the methods of the TextInput were expanded, which should not affect any existing functionality. However, to test this pull request, you can use the text inputs anywhere.
For more detailed testing, you can check the value of the onSelectionChange event(in a chat screen). Check the new positionX and positionY properties, which show the coordinates of the caret.
Offline 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 methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)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
Web
Apr-17-2023.11-45-38.mp4
Mobile Web - Chrome
\
Apr-17-2023.12-05-54.mp4
Mobile Web - Safari
Apr-17-2023.12-28-45.mp4
Desktop
iOS
Android