-
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 2024-11-29] [HOLD RN Upgrade] Android - Invoice - In invoice details page, reopening amount field shows cursor at beginning #50055
Comments
Triggered auto assignment to @sakluger ( |
@sakluger FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.In invoice details page, reopening amount field shows cursor at beginning What is the root cause of that problem?The weird bug happens by the old HOC Screen.Recording.2024-10-03.at.15.10.49.mov
What changes do you think we should make in order to solve the problem?Remove
What alternative solutions did you explore? (Optional)ResultScreen.Recording.2024-10-03.at.15.07.32.mov |
@nkdengineer thanks for the proposal. The root cause is not clear. Please explain why this bug happens only on android. |
@situchan Can you share the video that you tested in my test branch. |
@situchan That is because the We can see the log here in |
ProposalPlease re-state the problem that we are trying to solve in this issue.Sometimes the caret in the currency amount input is initially at the beginning instead of the end. What is the root cause of that problem?The native component public void onAttachedToWindow() { super.setTextIsSelectable(true);
useLayoutEffect(() => { viewCommands.setTextAndSelection( The execution order of making it selectable and setting the selection is random. If making it selectable runs after setting the selection, the selection resets to the beginning. To validate this, we can print logs before and after FLog.w(TAG, "Before: selectable = " + isTextSelectable() + " selectionStart = " + getSelectionStart() + " selectionEnd = " + getSelectionEnd());
super.setTextIsSelectable(true);
FLog.w(TAG, "After: selectable = " + isTextSelectable() + " selectionStart = " + getSelectionStart() + " selectionEnd = " + getSelectionEnd()); We’ll notice when this bug occurs, the selection is at the right ( This is not always reproducible and happened in my tests only about 1 out of 10 times. What changes do you think we should make in order to solve the problem?We could add a patch to int prevSelectionStart = getSelectionStart();
int prevSelectionEnd = getSelectionEnd();
super.setTextIsSelectable(true);
setSelection(prevSelectionStart, prevSelectionEnd); What alternative solutions did you explore? (Optional)N/A |
@nkdengineer here's video: bug.mp4@QichenZhu if it's RN bug, it should be fixed in upstream. Can you please create issue in RN? |
@situchan Here's a minimal reproduction: import { TextInput } from 'react-native';
import { useEffect, useRef} from 'react';
export default function App() {
const input = useRef(null);
useEffect(() => { setTimeout(() => input.current?.focus(), 1000); }, []);
return <TextInput ref={input} value='1.00' selection={{start: 4, end: 4}} />;
} Reproduction Steps
cd ReproducerApp
yarn
yarn android
npx react-native start
Expected result: The caret is at the end. Actual result: The caret is at the beginning. 23_1728368555.mp4 |
@QichenZhu thanks. Let's try to fix upstream first. If it takes too long, we can consider patch. |
The upstream issue facebook/react-native#46943 is resolved and the PR facebook/react-native#46948 is merged. It may take one or two months for the changes to be included in a release. |
@situchan what do you think - should we move to monthly and wait for the upstream PR to be released? That's what I think we should do, since this bug isn't a huge impact to customers. |
Let's assign @QichenZhu since their upstream PR was merged. |
Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@situchan do you still think we should continue holding for the upstream fix to be released, or should we try fixing immediately? |
@situchan mentioned he was on parental leave. Not sure if he’s back yet. @sakluger @aldo-expensify Could you respond to the above 2 comments? |
@QichenZhu I understand that the fix you did here has not been released yet, correct? |
No, it hasn’t been released yet.
Yes, I think so if we want it included in 0.75 or 0.76. Otherwise, it's expected to be released in 0.77. |
Requested here: reactwg/react-native-releases#622, maybe lets give it a week and then we reassess? |
Coming from issue #52029, it was decided to move forward with creating a patch with the fixes already merged into |
I think we should close this issue... this #52029 is pretty a dupe of this one (same root cause). Is anyone missing compensation for this issue or can I just close it? |
Compensation will be handled in #52029, so I'd say we can close this one. |
@aldo-expensify @sakluger I’m not sure if I should be paid since I only submitted a PR to react-native, not to our repo. What do you think? |
@QichenZhu we can compensate you for your work on the upstream PR. Please let me know once you've accepted the below offer. Summarizing payment on this issue: Contributor: @QichenZhu $250, sent offer via Upwork: https://www.upwork.com/nx/wm/offer/104978993 |
Thank you so much! Offer accepted. @sakluger |
Of course! I've paid out the offer, so we're good to close this issue now. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.65-5 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-11-29. 🎊 For reference, here are some details about the assignees on this issue:
|
@aldo-expensify @sakluger @QichenZhu / @situchan 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] |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.43-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
In invoice details page, reopening amount field must not show cursor at beginning
Actual Result:
In invoice details page, reopening amount field shows cursor at beginning
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6621403_1727807381706.Screenrecorder-2024-10-01-23-50-53-99_compress_1.mp4
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @saklugerThe text was updated successfully, but these errors were encountered: