-
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
[IS-3218] Fixed cursor issue on edit comment box #3434
[IS-3218] Fixed cursor issue on edit comment box #3434
Conversation
* | ||
* @param {Event} e | ||
*/ | ||
onSelectionChange(e) { |
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.
Overall looks good but this state change is unnecessary, I have already seen a drawback of this and I am migrating tis unnecessary state change. So my suggestion here would be to remove this as I mentioned over the issue.
cc: @Gonals
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.
@parasharrajat can you please let me know about the issue?
also, without state change, this issue will not be fixed.
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 change is going against our old pattern of not making the Component controlled.
🚀 Deployed to staging in version: 1.0.65-6🚀
|
mWeb - No cursor appears in edit comment boxExpected Result:The cursor is set to the end of the message. Actual Result:No cursor appears in edit comment box Actions Performed:
Platform:iOS Build:1.0.66-0 Notes/Images/Video:Bug5104994_Screen_Recording_20210609-103956_Chrome.mp4 |
App crashes when editing a commentExpected Result:User is able to edit and save the message successfully Actual Result:App keeps crashing when editing the message Actions Performed:
Platform:iOS Build:1.0.66-0 Notes/Images/Video:Bug5105065_20210609_112537_1_.mp4 |
I believe this is no longer a deployBlocker, as this fix was merged and is on staging. Removing the label from here and the deploy issue. |
@Julesssss just a heads up, I feel that the change we have done here has unnecessary state updates. We just want to set the cursor at the end of the text when we initiate the edit. So why we are re-rendering it on every input and setting the cursor, making it a controlled input. I believe we are following uncontrolled Textinput throughout the app. Even here you can see at this line So I think I can submit a PR to replace the changes here with
What are your thoughts? |
Thanks @parasharrajat, I need to review this on Monday but I think you make a good point. Have set a reminder to return to this. |
@Julesssss But for the 2nd point, we can use Thanks |
🚀 Deployed to production in version: 1.0.68-4🚀
|
@Julesssss did you get chance to look at #3434 (comment) ? |
Ah, sorry I haven't yet. That makes sense to me though, good spot. Would you like to raise an issue for this, and we can get it exported? |
It's fine. Just a small change. Let me know PR will be up in no time. |
I'll try to add a small bonus to an existing contract instead. Thanks @parasharrajat |
|
||
this.state = { | ||
draft: this.props.draftMessage, | ||
selection: { |
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.
Setting selection without focusing the input internally focuses the input on Safari which is then shifts to other elements causing bugs such as #15105
Details
Fixed Issues
Fixes #3218
Tests
QA Steps
Tested On
Screenshots
Web
Screen.Recording.2021-06-08.at.9.13.46.AM.mov
Mobile Web
Desktop
Screen.Recording.2021-06-08.at.9.22.54.AM.mov
iOS
Screen.Recording.2021-06-08.at.9.09.10.AM.mov
Android
Screenrecorder-2021-06-08-21-25-56-100_0_COMPRESSED.mp4