-
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
Login - Clicking the eye icon moves the cursor to the beginning #13308
Comments
kbecciv
added
Daily
KSv2
Bug
Something is broken. Auto assigns a BugZero manager.
labels
Dec 3, 2022
Triggered auto assignment to @bfitzexpensify ( |
Proposal: Issue: Solution: Get the previous location of the cursor before updatin the state and in the callback rest the cursor back to that location Code: diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js
index fe29ff79b..e5234a66f 100644
--- a/src/components/TextInput/BaseTextInput.js
+++ b/src/components/TextInput/BaseTextInput.js
@@ -187,7 +187,15 @@ class BaseTextInput extends Component {
}
togglePasswordVisibility() {
- this.setState(prevState => ({passwordHidden: !prevState.passwordHidden}));
+ const cursorLocation = this.input.selectionStart;
+ this.setState(prevState => ({passwordHidden: !prevState.passwordHidden}), () => {
+ if (cursorLocation && this.input.setSelectionRange) {
+ setTimeout(() => {
+ this.input.setSelectionRange(cursorLocation, cursorLocation);
+ }, 0);
+ }
+ return false;
+ });
}
Video: Screen.Recording.2022-12-03.at.7.58.57.PM.mov |
Yes fixed in that PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
**Issue found when executing PR #13187
Action Performed:
Expected Result:
The cursor stays in the same place
Actual Result:
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.36.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug5846573_Recording__3174.mp4
Bug5846573_13187_iOS.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: