-
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
[$1000] Chat - Tapping eye icon for protected pdf file moves cursor to the start of the field #21727
Comments
Triggered auto assignment to @laurenreidexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease 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 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 App/src/components/TextInput/BaseTextInput.js Line 352 in 776ea5d
In iOS safari and iOS native, we need to control Add the selection state
For iOS safari, get selection from the input element when toggle
For iOS native, add
Result21727_mac_chrome.mp4What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~01f00fa406bef36c56 |
Current assignee @laurenreidexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
I think an important question is, what is the expected behavior? As @s-alves10 mentioned in his proposal, we have 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. |
Please check the alternative as well |
@sobitneupane please review and confirm if any of the proposals work. thanks! |
Alternative solution from @s-alves10's proposal looks good to me.
Turn out that the solution won't work for IOS safari. |
Triggered auto assignment to @johnmlee101, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@sobitneupane Proposal |
@s-alves10 If we remove onMouseDown, then the input will lose focus which is not expected. If the proposal won't work for IOS/safari, then we will wait for better proposal which works on all devices and have the text input focused. Will your updated proposal yield the expected output? |
That's why I added the below code segment in the proposal |
Yes. the proposal works on all platforms. |
This would however break a11y behavior. I don't know how much focus we put into that for this app. |
|
If a user tabs focus to the eye checkbox and hits space, it also triggers the behavior (as expected) to toggle |
@rain2o |
@s-alves10 You might have to update your proposal. There are some recent changes(migration from class -> functional component) in
Also please do consider above statements from @rain2o. We would definitely not want to add an extra space to the input. |
The original issue should be resolved now, but the iOS fix is still pending -> facebook/react-native#38678 Also, I think it would be a good idea to merge the react-native-web fix to upstream 😄 |
@pac-guerreiro, sounds good - can you make a PR to update the |
Issue reproducible in Build 1.3.52-3. Bug6159478_bandicam_2023-08-09_18-13-44-267.mp4 |
Thanks for your work on this issue so far everyone, and thanks @pac-guerreiro for creating an upstream PR for the react-native portion of this. Can you also create an upstream issue and PR for the react-native-web portion as well? Posted more detailed thoughts here.
@NikkiWines normally we have to manually publish the react-native-web fork, but as stated in here we're moving away from forks and to https://github.com/ds300/patch-package because it's less internal work to manage. Thanks everyone! |
Is this issue waiting for proposals? |
Thank you for the input! I'm opening a PR to react-native-web with my fix. Meanwhile, if there was no bump to the current version of Expensify/react-native-web in the last app release, then the fix will not be present. Please, confirm this @lanitochka17 and retest it after the version is bumped to see if the fix worked. @s-alves10 regarding the iOS fix, it's still waiting for approval on react-native repo 😄 |
Sorry for the delay, I had a two week vacation. I just opened a PR for necolas/react-native-web with my fix. The PR with the iOS fix is still pending review. |
@pac-guerreiro how is the PR going? |
@pac-guerreiro is there a PR up for this still? |
Sorry for the delay, the PR for react-native-web was closed but my fix was added manually by necolas - necolas/react-native-web@5e41208 - and it will be available in Regarding the react-native PR, there are no updates from Meta side. I guess I'll need to mention more reviewers. |
What are the next steps on this one? |
@pac-guerreiro bump |
@pac-guerreiro @sobitneupane is there any latest here? |
@laurenreidexpensify I'm still waiting on updates from React Native PR |
Still no updates on React Native PR |
1 similar comment
Still no updates on React Native PR |
When the app starts using RN 0.73.1, I'll check if the new version fixes the underlying issue 😄 |
Still holding on #31381 |
@pac-guerreiro looks like #31381 is live - we have Upgraded react-native to 0.73+ so can we pick this one up again? |
@laurenreidexpensify Thanks for the heads up! I'll test this asap! |
Screen.Recording.2024-02-09.at.19.07.42.mp4@laurenreidexpensify The issue still persists on iOS. I reported this on facebook/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. |
@pac-guerreiro have Meta responded yet? |
@laurenreidexpensify Nothing so far but I just bumped them 😄 |
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. |
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 #21367
Action Performed:
Expected Result:
Cursor should stay where it was
Actual Result:
Cursor moves to the start fo the field
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.33.3
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug6108545_video_33__1_.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @laurenreidexpensifyThe text was updated successfully, but these errors were encountered: