You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field #21727
BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
For iOS native, add onSelectionChange to get selection, and set selection manually when secureTextEntry toggles because control selection doesn't work well.
changed the title [-]Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/-][+][$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/+]on Jun 28, 2023
I think an important question is, what is the expected behavior? As @s-alves10 mentioned in his proposal, we have onMouseDown={(e) => e.preventDefault()} on the checkbox surrounding the eye icon. This prevents the checkbox from gaining focus when we click on it and keeps focus on the text input.
The solution he proposed "fixes" it, in that it allows the checkbox to gain focus when you click it. However, this could cause unexpected behavior for users, if they click it, then continue to type because focus will no longer be in the textbox. But, from an accessibility standpoint, I think it does make sense for it to behave this way, otherwise we'd have different behavior for click vs tab+space.
The decision on how this is expected to behave could determine if a different change is required or not.
changed the title [-][$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/-][+]Hold on #31381 [$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/+]on Jan 15, 2024
changed the title [-]Hold on #31381 [$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/-][+][$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/+]on Feb 8, 2024
BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Jun 27, 2023
Triggered auto assignment to @laurenreidexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 27, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)dummy-1111 commentedon Jun 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tapping eye icon for protected pdf file moves cursor to the start
What is the root cause of that problem?
Please check the code below
App/src/components/TextInput/BaseTextInput.js
Line 348 in 52a1891
I'm not sure what does this code do but preventing default action on
mousedownevent makesTextInputworks weird.In addition, TextInput cursor goes to the end when toggle secureTextEntry in iOS native as you can see below
TextInput cursor goes to the beginning when toggle secureTextEntry in iOS safari.
These are the root cause of the issue.
What changes do you think we should make in order to solve the problem?
Prevent default action for
mouseupevent. AddonMouseUpprops to theCheckboxand add the following code hereApp/src/components/TextInput/BaseTextInput.js
Line 352 in 776ea5d
In iOS safari and iOS native, we need to control
selectionmanually.Add the selection state
For iOS safari, get selection from the input element when toggle
For iOS native, add
onSelectionChangeto get selection, and set selection manually whensecureTextEntrytoggles because control selection doesn't work well.Result
21727_mac_chrome.mp4
What alternative solutions did you explore? (Optional)
[-]Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/-][+][$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/+]melvin-bot commentedon Jun 28, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01f00fa406bef36c56
melvin-bot commentedon Jun 28, 2023
Current assignee @laurenreidexpensify is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jun 28, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)rain2o commentedon Jun 28, 2023
I think an important question is, what is the expected behavior? As @s-alves10 mentioned in his proposal, we have
onMouseDown={(e) => e.preventDefault()}on the checkbox surrounding the eye icon. This prevents the checkbox from gaining focus when we click on it and keeps focus on the text input.The solution he proposed "fixes" it, in that it allows the checkbox to gain focus when you click it. However, this could cause unexpected behavior for users, if they click it, then continue to type because focus will no longer be in the textbox. But, from an accessibility standpoint, I think it does make sense for it to behave this way, otherwise we'd have different behavior for click vs tab+space.
The decision on how this is expected to behave could determine if a different change is required or not.
dummy-1111 commentedon Jun 28, 2023
Please check the alternative as well
112 remaining items
laurenreidexpensify commentedon Nov 8, 2023
@pac-guerreiro @sobitneupane is there any latest here?
pac-guerreiro commentedon Nov 20, 2023
@laurenreidexpensify I'm still waiting on updates from React Native PR
pac-guerreiro commentedon Nov 27, 2023
Still no updates on React Native PR
pac-guerreiro commentedon Dec 7, 2023
Still no updates on React Native PR
pac-guerreiro commentedon Dec 18, 2023
When the app starts using RN 0.73.1, I'll check if the new version fixes the underlying issue 😄
[-][$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/-][+]Hold on #31381 [$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/+]laurenreidexpensify commentedon Jan 22, 2024
Still holding on #31381
laurenreidexpensify commentedon Feb 8, 2024
@pac-guerreiro looks like #31381 is live - we have Upgraded react-native to 0.73+ so can we pick this one up again?
[-]Hold on #31381 [$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/-][+][$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field[/+]pac-guerreiro commentedon Feb 9, 2024
@laurenreidexpensify Thanks for the heads up! I'll test this asap!
pac-guerreiro commentedon Feb 9, 2024
Screen.Recording.2024-02-09.at.19.07.42.mp4
@laurenreidexpensify The issue still persists on iOS. I reported this on react/react-native#38676
Meanwhile, I could apply this fix through a patch if you want, otherwise we'll have to wait on meta team response.
laurenreidexpensify commentedon Feb 20, 2024
@pac-guerreiro have Meta responded yet?
pac-guerreiro commentedon Feb 21, 2024
@laurenreidexpensify Nothing so far but I just bumped them 😄
laurenreidexpensify commentedon Mar 21, 2024
I am going to close this. It feels like an edge case, and we can reopen if this is ever reported as an issue by live customers.