-
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
IOU - digit appears cutoff for a moment when entering a digit before decimal point #18579
base: main
Are you sure you want to change the base?
IOU - digit appears cutoff for a moment when entering a digit before decimal point #18579
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@aldo-expensify @parasharrajat One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM 👌
Is there a reason to keep this draft? |
Based on Callstack workflow - we need to get local approve -> pass QA approve -> and after it - i can make PR as ready for review |
Our QA is on vacation now - in that case - PR is ready for review |
Will review this today. |
BUG: WEB: Cursor jumps to the end. Steps:
BUG: WEB: Cursor jumps to the end when a digit is deleted from the middle. Steps: same as above. |
Hey @parasharrajat is it related to mobile web or web itself? |
It's desktop web browser. |
Fixed - please check again |
Ok, it seems we are just preventing the new logic on desktop browsers to solve the bug. |
Can we try to find a way to fix this bug's root cause? Or Can you share more details about your analysis on this bug? |
@@ -22,6 +23,7 @@ class TextInput extends React.Component { | |||
<BaseTextInput | |||
// eslint-disable-next-line react/jsx-props-no-spreading | |||
{...this.props} | |||
shouldWaitWidthCalculation={BrowserUtils.isMobile()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @parasharrajat posted, I agree it would be good to investigate this further before just disabling it for desktop. If we don't understand the cause, we may be creating a bug.
Hey sure - the root case of the bug - calculation width for text input should be dynamic (as it is now) but new width should be applied before final value comes inside input. Other case why we should extract only for android web - because for desktop and web - we use local state inside BaseTextInput - and not using it - will cause issue with jumping cursor - why it's happened? Because when we set state locally it will immediately applies to text input and text input does not have any maxLength limitation (everything controlling outside). You can see on screenshot - that in console log - i was trying to add 2 between 1 and 3 (position 2). |
@aldo-expensify @parasharrajat - Friendly bump on @narefyev91 comments above. |
Will be checking in in one hour. |
Same, I spent some time on Friday by the end of the day trying to understand the problem and changes. I'll get back to it today. |
Sorry, I didn't get to it today, I'll try tomorrow again |
Definitely need help from @aldo-expensify for the next steps. |
@aldo-expensify is it possible to see this on any video? because currently i was not able to reproduce on real device 8mb.video-y1D-6vlZXTys.mp4 |
@aldo-expensify - Little bump on #18579 (comment) so we can keep this moving forward please. |
I'll try again and get a recording if I can replicate |
@parasharrajat can you spend some time investigating this and possible side effects of the solution? I think your thoughts can be useful here. I don't think I have anything in my environment that allows me to debug this better than you. |
@narefyev91 ahh I noticed that this is reproducible in android mWeb if you use you computer's keyboard... but if you use the keyboard in the view it doesn't happen. I think we can ignore this report then for mWeb because it doesn't happen in a real use case. |
To summarize...
This last point feels like workaround and it would be good to decide if we are fine with it, and see if there is a better solution for it. It also feels like a workaround because the digit "cutoff" issue probably exist in desktop too, but it just happens too fast and we don't see it. Do we know if a keyboard that is not <BigNumberPad can ever show up in these views in small screens? I'm guessing that the answer is no. |
Asked here for advice on how to proceed: https://expensify.slack.com/archives/C01GTK53T8Q/p1685477825309709 We will accept the workaround, but we should add a comment above |
@parasharrajat can you test and review this again 🙏 ? |
I will do that asap. Overall, I was asking about the logic on this PR. Took some time off for health reasons. |
thanks
Ok!, I'm fine with the delay mechanism implemented, the main push back for me was the workaround of disabling it when not in mobile.
I hope you area feeling better! |
Yup keyboard will never be shown for small screens for sure. |
@aldo-expensify @parasharrajat hey guys - what will be the next steps here? |
I will test it in a few hours. Wasn't working till today. |
@parasharrajat @aldo-expensify do you think guys this we should move this ticket on hold - because seems this one #19961 and #16696 will fully change the logic of current component and potentially will fix current issue with cut of? |
Hey, I just quickly tested the changes from #16696 PR, and confirm the effect is less visible: Screen.Recording.2023-06-06.at.14.58.11.movHowever, the issue is still there. If you go frame by frame through the video you can see that for one frame the state is still there. |
Interesting that this issue mostly reproduced on real device - on emulator i was not able to see such massive delay between expanding width and inserting new character. I think it will make cense to recap when your PR will be merged |
@parasharrajat and @aldo-expensify - Bump on the comments here and here. After looking it over, can you share the next steps that should be done here? Do you think we should move forward and finish up this PR? If so, how close are we to merging? |
@strepanier03 Hey! I think we are in a process of re-writing the whole area - this is the first one PR #20186, which i hope will be good to go soon, and this one margelo#10 - will also fix all issues which we faced with auto growing - in my view - we should put this onhold - and waiting when all pr's will be finalised and merged (also we need a new version of react native merged to Expensify Expensify/react-native#55). Hope that makes cense |
Thanks @narefyev91 for the update. I agree, we should redo this PR. Let's hold this PR and I will watch the other ones. |
@strepanier03 We are doing a major refactor of the main component in #20186 which will make the changes of this PR obsolete. The timeline to finish this #17801 might be close to 15 days. There will be 2 PRs to complete this.
|
We can move forward here. |
What is the latest on this? Do we still need margelo#10? |
Yeah the PR would still be needed + probably a fix on the native side (or a good other solution that doesn't run into the native bug). |
We could also think about opening this to external contributors, however, as the underlying issue is one in react-native I'd be afraid of proposals that are rather esoteric, trying to work around the bug instead of really trying to fix the underlying problem. |
Agree. Happy to wait here. |
Agree too, lets hold |
Details
When trying to add new digit before dot, app cuts off the digit for few seconds on android chrome
Fixed Issues
$ #17801
$ #17801 (comment)
Tests
Offline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
android-web.mp4
Mobile Web - Safari
ios-web.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov