-
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
[HOLD for payment 2024-12-20] [$250] BNP-On entering number&decimal point, first digit moves inwards slightly #53286
Comments
Triggered auto assignment to @isabelastisser ( |
@isabelastisser Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~021863570868574579192 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The first digit briefly flickers when entering a money request amount. What is the root cause of that problem?The width of the amount input is designed to autogrow. Since React Native text input lacks the autogrow feature, we implement it using an underlying text view and synchronize the width of the input container and the underlying text.
App/src/components/TextInput/BaseTextInput/index.native.tsx Lines 450 to 456 in 5bb0e9b
The width of the text input is set to fit its container. App/src/components/TextInput/BaseTextInput/index.native.tsx Lines 352 to 353 in 5bb0e9b
When typing in the input, the content updates immediately, but the width takes time to grow because the process is asynchronous and requires communication between JS and native sides. What changes do you think we should make in order to solve the problem?Now that we've limited the container width, there's no need to strictly limit the width of the text input itself. Inspired by the approach on web platforms below, we could also add extra width on native platforms. App/src/components/TextInput/BaseTextInput/index.tsx Lines 517 to 519 in 5bb0e9b
App/src/components/TextInput/BaseTextInput/index.native.tsx Lines 352 to 353 in 5bb0e9b
autoGrow ? {width: textInputWidth + 100} : [styles.flex1, style.w100],
autoGrow ? styles.overflowVisible : styles.overflowHidden,
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?This only involves stylesheet changes, so tests aren't necessary. What alternative solutions did you explore? (Optional) |
I think the RCA correctly identifies that the asynchronous width adjustment and lack of proper overflow control are the main causes of the flickering issue. I tested the proposal, and it works as expected, fixing the issue. @neil-marcellini what do you think about their solution? While we may need to confirm some details, the general idea seems sound. With that, I think we can go with @QichenZhu's proposal. I'll test further in the PR to avoid regressions. 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
I agree, it looks like a good solution. |
📣 @brunovjk 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @QichenZhu 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thanks for the offer. I'll open a PR on Monday. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
FYI I reverted the PR associated with this issue because it caused this blocker #53992. Please work on a new solution taking that into account. |
@QichenZhu Any idea what might have caused the issue? Thanks |
I think the input was just growing to fill up space and pushing the whole component over |
Yeah, my PR aimed to increase the input width without affecting the layout, but it fails in Chrome.
When focusing the input, Chrome scrolls its container horizontally. This doesn’t seem to happen in Safari or native apps. I’ve tested some possible solutions:
focusTimeoutRef.current = setTimeout(() => textInput.current?.focus({preventScroll: true}), CONST.ANIMATED_TRANSITION); App/src/pages/iou/MoneyRequestAmountForm.tsx Line 136 in 0958370
textInput.current.focus({preventScroll: true}); I'm still looking for a better solution, ideally fixing it inside the input component without changing its usage. |
Thank you for the investigation @QichenZhu. I will also test this approach on my end. It will require even more careful testing this time, so I don’t think I’ll finish today, but I’ll let you know if I find anything. Please feel free to reach out if you need any assistance. Thanks! |
@brunovjk Thanks for your time. The approach mentioned earlier has the drawback that it cannot prevent scrolling on keyboard focus. Here are another two possible solutions:
App/src/pages/iou/MoneyRequestAmountForm.tsx Line 259 in 0958370
I’m open to any suggestions. Thanks for your help! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 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 2024-12-20. 🎊 For reference, here are some details about the assignees on this issue:
|
@brunovjk @isabelastisser @brunovjk The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Thanks for the effort @QichenZhu, I'll do some tests today and get back to you ASAP. |
After testing, skipping the fix for web and applying it only on native platforms resolves the issue effectively. So far, everything works as expected in my tests. Thanks again for the great work @QichenZhu! How have your tests been going? Let's test this very carefully before calling in the interns. |
Thank you so much @brunovjk! I tested the steps in this issue, #53992, and this comment. Looks good so far. |
Great @QichenZhu! Could you update the Test Steps in your draft PR to include these cases? Can you think of any other cases where our changes might have affected? After that, I think we can release the PR to the design team for review. What do you think? Thanks. |
Update: Please ignore the payment warnings. The PR has been reverted and we are already working on the solution here. |
Thanks for the heads up, @brunovjk! |
FYI, I will be OOO from Dec 23 to Jan 6, so please reassign the issue to another team member for urgency, IF needed. |
Update: PR still under review. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: V9.0.68-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
On entering 3 and decimal point, the digit 3 must not move.
Actual Result:
On entering 3 and decimal point, the digit 3 moves inwards slightly in android but not in mweb.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6679447_1732823534311.az_recorder_20241129_011626.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @isabelastisserThe text was updated successfully, but these errors were encountered: