-
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
[HOLD for payment 2023-10-02] [$500] Request money - No autofocus blink cursor shown in Request money page #26994
Comments
Triggered auto assignment to @NicMendonca ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue:Request money - No autofocus blink cursor shown in Request money page What is the root cause of that problem?Safari's WebKit rendering engine interacts differently with the JavaScript event queue compared to other browsers. This divergence is particularly evident when programmatically focusing an input element. While InteractionManager.runAfterInteractions() is designed to execute actions after any active animations, its interaction with Safari results in differing behavior. Specifically, Safari may require direct user actions for certain tasks, including focusing on an input, leading to timing inconsistencies in script execution and due to this What changes do you think we should make in order to solve the problem?To resolve this, we should modify the focusTextInput method by introducing an internal setTimeout function with a delay of 0ms. This ensures the focus command is repositioned to the end of the event queue, effectively navigating around the idiosyncrasies of Safari. Reference Code: Updated Code:
ResultScreen.Recording.2023-09-08.at.7.21.09.AM.mp4ExplanationUsing InteractionManager.runAfterInteractions() inside React Native (or in environments where it's supported) ensures that any work wrapped inside it gets executed after all animations and interactions have finished. However, "finished" doesn't always mean "rendered to the screen," especially on some browsers or environments. There might be slight differences in how the browser's rendering engine processes updates to the DOM and how it queues JavaScript events. When we're using InteractionManager.runAfterInteractions(), the intended behavior is to delay JavaScript execution until animations have completed, but this does not necessarily guarantee that the browser has completed its rendering process. In Safari's case, the rendering and JavaScript event queues might interact a bit differently than in other browsers. By adding the setTimeout with a delay of 0ms, we're essentially placing the focus event at the end of the current JavaScript event queue. Even though the delay is 0ms, it doesn't execute immediately; instead, it waits for the current queue to be emptied. This slight delay, even though minuscule, gives Safari the time it needs to complete the rendering process, ensuring that the focus event works correctly. To summarize, while InteractionManager.runAfterInteractions() ensures that JS execution is deferred until animations are done, it doesn't account for potential idiosyncrasies in browser rendering. The nested setTimeout, even with a 0ms delay, provides that extra assurance that the focus will be executed after the rendering process has completed in the Safari browser. |
@NicMendonca Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@NicMendonca Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Job added to Upwork: https://www.upwork.com/jobs/~01d0c4dd10133dafa2 |
Current assignee @NicMendonca is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue:Request money - No autofocus blink cursor shown in Request money page What is the root cause of that problem?In
we're already using In
we're still using => focusTextInput is not called when the transition is ended What changes do you think we should make in order to solve the problem?In MoneyRequestSelectorPage we create new state
and pass In
ResultScreen.Recording.2023-09-12.at.17.23.24.mov |
@NicMendonca, @fedirjh Eep! 4 days overdue now. Issues have feelings too... |
@Krishna2323 What's the external factor you referring to? why does the @tienifr The root cause is not clear to me can you elaborate more?
I don't think this is correct. The input appears to be initially focused correctly, but it loses focus instantly. Please check the video below. I added a console log inside the focus function, and it seems that the focus works as expected. However, it promptly loses focus, which is clearly noticeable. CleanShot.2023-09-13.at.10.17.05.mp4 |
@fedirjh As we can see there're 2 places that call focusTextInput, focusTextInput is called when we open the page (useFocusEffect), but it is not called when the transition is ended (onEntryTransitionEnd) |
After the input is focused (in useFocusEffect), there're some transitions of navigation (this causes the input blur), that why we need to wait for them end before focusing on the input |
why does the |
Ah, because in |
run focusTextInput in useFocusEffect can not make sure it runs after the transition is end. |
Proposal (Updated)Please re-state the problem that we are trying to solve in this issue.Request money - No autofocus blink cursor shown in Request money page. What is the root cause of that problem?Upon investigation, the root cause appears to be the default behavior of the TopTab.Navigator. Without explicit configuration, the navigator might interfere with the keyboard's display settings, leading to its unintended dismissal or erratic behavior, especially when switching tabs or interacting with input fields. What changes do you think we should make in order to solve the problem?To counteract this issue, we should modify our TopTab.Navigator configuration by setting the keyboardDismissMode property to "none". This would ensure that the keyboard remains consistent in its behavior, regardless of interactions within the navigator. By applying this change, we will override the default behavior and prevent the keyboard from dismissing due to tab interactions. We just need to pass App/src/libs/Navigation/OnyxTabNavigator.js Lines 30 to 47 in d68263a
ResultScreen.Recording.2023-09-13.at.4.27.18.PM.mov |
@fedirjh, pls review updated proposal. |
@Krishna2323 That makes sense to me. I believe it will provide us with greater flexibility in managing the keyboard. This proposal from @Krishna2323 looks good to me. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@fedirjh, PR is ready for review. |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
@MariaHCD, considering we also addressed two additional issues and successfully resolved one of them, would this qualify for a bonus? |
@Krishna2323 I believe the additional issue identified had the same root cause so I am not sure this would be eligible for a bonus. We normally pay out bonuses if the issue/solution becomes more complicated/challenging and the contributor has to invest more time/effort into the issue. However, I will defer to @NicMendonca @Krishna2323 could you can explain why you feel your work on this issue deserves a bonus? |
Hmm, so we tried to fix the same issue on iOS native but that led to a bit of a delay in getting the PR merged. I think it's all part of the review process and you did handle addressing the reviews with urgency so I think paying out the bonus in this case is fine. Regardless, I'll leave the final call to @NicMendonca |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-02. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@fedirjh bump on the BZ issue ^^ |
Reporter: @ashimsharma10 - $50 |
@Krishna2323 @ashimsharma10 - you've both been paid 🎉 @fedirjh can you please accept the offer in Upwork? |
@NicMendonca Thank you very much for the bonus, I appreciate it. |
@fedirjh bump bump on BZ checklist |
BugZero Checklist:
Regression Test Proposal
|
@fedirjh thanks! You've been paid via Upwork🎉 All set here ✅ |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
( however if the request money page was previously set to scan or distance pages, such behaviour doesn't appear. Thus make sure after clicking request money, manual section is opened automatically)
Expected Result:
Consistency in pages in split money and request money ( Manual)
Actual Result:
No autofocus blink cursor shown in Request money page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.3.65-6
Reproducible in staging?: Y
Reproducible in production?: Y
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
Screen.Recording.2023-09-03.At.5.33.37.Pm.mp4
2023-09-07.22.44.53.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ashimsharma10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693742251468319
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: