-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-3186] Fixed cursor position issue on Android #3374
Conversation
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.
Thanks for making those changes, this is looking much better! Another thing you'll have to update is to change index.native.js of TextInputFocusable to index.ios.js since you have an android specific one now. I also have a question, what changes here are you making that are specific to android, and would ios break if they had the same changes in them? Because if not, since there is so much overlapping code in the ios.js and android.js files, it would be easier to maintain in the future if they were just both in native.js
TextInput |
…tFocusable/index.ios.js
Do you mean the |
But I need that prop in android to fix this issue. |
Ah I see what you mean now, although you'll still need to do this step:
Additionally, at the top of the iOS / Android file can you explain why they need to be separated and link to the react native issue where this problem is being tracked? |
DONE, Please have a look |
✋ 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 in version: 1.0.65-1🚀
|
🚀 Deployed to production in version: 1.0.68-4🚀
|
@@ -233,6 +233,7 @@ class ReportActionCompose extends React.Component { | |||
* @param {String} newComment | |||
*/ | |||
updateComment(newComment) { | |||
this.textInput.setNativeProps({text: 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.
@aliabbasmalik8 Sorry you ping you this way but I just want to know why did you add this? I am doing some changes to the component and I just want to know was there an issue, that required this. It's pretty urgent we have a couple of deploy blockers.
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.
t's used to update comments ASAP because in android there is some issue with the selection position when we update without this.
What issue you are facing?
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.
There are multiple things I am working on so I was trying to understand the old code. There is an issue when the cursor jumps. There is an issue when the app crashes......so on.
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.
Got it, this code working perfectly and tested as well. you can mention PR here on which you are working so can help.
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.
Hmm I could be wrong, but this does not seem like a correct usage of setNativeProps()
... seems like there are various ways we clear the text input and I'm having a really hard time understanding why... please leave more context in the code in the future.
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.
Yes, we can use some other ways as well but you can see in some other issue conversation reviewer like the way of direct manipulation because uncontrolled input used in the app.
@jboniface
Details
This issue occurs only in the android platform so the solution is android specific. I used Direct Manipulation
to fixed this issue because
selection
props ontextinput
have an issue on native platformshttps://github.com/facebook/react-native/issues/29063
Fixed Issues
Fixes #3186
Tests
QA Steps
Tested On
Screenshots
Web
VIDEO: https://recordit.co/0uUXWucubT
Mobile Web
VIDEO: https://recordit.co/1Y0RirncEZ
Desktop
VIDEO: https://recordit.co/w6lrt5jZqy
iOS
VIDEO: https://recordit.co/vkL2JOqSCL
Android
Screenrecorder-2021-06-04-18-18-44-593_0_COMPRESSED.mp4