-
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
[$1000] Add payment method button jumps when tapping back button on Paypal page #14843
Comments
Triggered auto assignment to @NicMendonca ( |
Bug0 Triage Checklist (Main S/O)
|
RPReplay_Final1675777517.MP4Can confirm its only happening with the |
Job added to Upwork: https://www.upwork.com/jobs/~01d9d6800730a96ae0 |
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 - @mananjadhav ( |
Triggered auto assignment to @mountiny ( |
ProposalProblemWhen we navigate from the PayPal screen (which at the time has keyboard open) back to the Payment page, the keyboard closing behavior interferes with the Payment page View's layout, causing the SolutionWe should disable the diff --git a/src/components/ScreenWrapper/index.js b/src/components/ScreenWrapper/index.js
index e7ba7e5d0e..64ddd46319 100644
--- a/src/components/ScreenWrapper/index.js
+++ b/src/components/ScreenWrapper/index.js
@@ -96,7 +96,11 @@ class ScreenWrapper extends React.Component {
paddingStyle,
]}
>
- <KeyboardAvoidingView style={[styles.w100, styles.h100, {maxHeight: this.props.windowHeight}]} behavior={this.props.keyboardAvoidingViewBehavior}>
+ <KeyboardAvoidingView
+ style={[styles.w100, styles.h100, {maxHeight: this.props.windowHeight}]}
+ behavior={this.props.keyboardAvoidingViewBehavior}
+ enabled={this.props.keyboardAvoidingViewEnabled}
+ >
<HeaderGap />
{// If props.children is a function, call it to provide the insets to the children.
_.isFunction(this.props.children)
diff --git a/src/components/ScreenWrapper/propTypes.js b/src/components/ScreenWrapper/propTypes.js
index 46cc9ed631..08aaaa151c 100644
--- a/src/components/ScreenWrapper/propTypes.js
+++ b/src/components/ScreenWrapper/propTypes.js
@@ -28,6 +28,9 @@ const propTypes = {
/** Indicates when an Alert modal is about to be visible */
willAlertModalBecomeVisible: PropTypes.bool,
}),
+
+ /** The enabled flag to pass to the KeyboardAvoidingView */
+ keyboardAvoidingViewEnabled: PropTypes.bool,
};
const defaultProps = {
@@ -37,6 +40,7 @@ const defaultProps = {
onTransitionEnd: () => {},
modal: {},
keyboardAvoidingViewBehavior: 'padding',
+ keyboardAvoidingViewEnabled: true,
};
export {propTypes, defaultProps};
diff --git a/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js b/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
index 9a480454ea..5f8c0a6212 100644
--- a/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
+++ b/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
@@ -342,7 +342,7 @@ class BasePaymentsPage extends React.Component {
// Determines whether or not the modal popup is mounted from the bottom of the screen instead of the side mount on Web or Desktop screens
const isPopoverBottomMount = this.state.anchorPositionTop === 0 || this.props.isSmallScreenWidth;
return (
- <ScreenWrapper>
+ <ScreenWrapper keyboardAvoidingViewEnabled={false}>
<HeaderWithCloseButton
title={this.props.translate('common.payments')}
shouldShowBackButton
|
Working well after the fix: Screen.Recording.2023-02-07.at.22.12.03.mov |
Proposal 2I managed to find the actual root cause of this. This happens due to the diff --git a/src/pages/settings/Payments/AddPayPalMePage.js b/src/pages/settings/Payments/AddPayPalMePage.js
index ba2b5ec994..2b3aa88ae1 100644
--- a/src/pages/settings/Payments/AddPayPalMePage.js
+++ b/src/pages/settings/Payments/AddPayPalMePage.js
@@ -23,6 +23,7 @@ class AddPayPalMePage extends React.Component {
this.state = {
payPalMeUsername: '',
payPalMeUsernameError: false,
+ didGoBack: false,
};
this.setPayPalMeUsername = this.setPayPalMeUsername.bind(this);
this.focusPayPalMeInput = this.focusPayPalMeInput.bind(this);
@@ -54,11 +55,18 @@ class AddPayPalMePage extends React.Component {
render() {
return (
- <ScreenWrapper onTransitionEnd={this.focusPayPalMeInput}>
+ <ScreenWrapper onTransitionEnd={() => {
+ if (!this.state.didGoBack) {
+ this.focusPayPalMeInput();
+ }
+ }}>
<HeaderWithCloseButton
title={this.props.translate('common.payPalMe')}
shouldShowBackButton
- onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_PAYMENTS)}
+ onBackButtonPress={() => {
+ this.setState({didGoBack: true});
+ Navigation.navigate(ROUTES.SETTINGS_PAYMENTS);
+ }}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<View style={[styles.flex1, styles.p5]}>
Some other variations of this solution that I suggest include:
But the approach should generally be similar: call the |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Here is the diff for variation 1 of the above solution, it's clean and works well |
We might also want to take a look at other places where we use |
ProposalPlease re-state the problem that we are trying to solve in this issue.On back navigation the add payment method button jumps What is the root cause of that problem?On back navigation after hiding the screen we are focusing the paypal input that causes the keyboard to briefly shows up resulting in the jump behaviour. The focus call is initialised by the What changes do you think we should make in order to solve the problem?
Step 2 in pseudo-code:
We can apply the same fix to other effected pages What alternative solutions did you explore? (Optional)
|
@s77rt I thought about using Also I think |
Thanks for the feedback @tienifr. I do have answers for your concerns but let's not focus on the technical details for now not to create unnecessary back and forth communications. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.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-02-24. 🎊 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.
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:
|
@parasharrajat @mananjadhav Would you be bale to handle the checklist points please? Thanks! |
I'll try to update the checklist by today/tomorrow |
📣 @mananjadhav! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
Regression Test Proposal
Do we agree 👍 or 👎 Apart from that I tried to track the PR but I think this existed long before. @parasharrajat do you have any insights on which PR must've caused this regression? |
No idea, my best guess is that it came with a React-navigation version upgrade. |
looks good, I think we are fine without the PR |
@NicMendonca this is ready for payout today. Can you please help with that? |
@NicMendonca Should be able to get to this today 🙌 |
@mountiny @NicMendonca Quick bump on this one. |
I am so sorry @mananjadhav @parasharrajat can you please apply to the job/ accept my offer: https://www.upwork.com/jobs/~01d9d6800730a96ae0 |
@NicMendonca applied for reporting |
@gadhiyamanan yep - I got yours! |
@gadhiyamanan paid - thank you! |
@NicMendonca please close the upwork contract 🙇♂️ |
@mananjadhav paid! |
@parasharrajat I will check back here for your payment tomorrow because of this. Thanks! |
Everyone had been paid 🎉 I am incredibly sorry again for the delay! Thank you! |
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:
Expected Result:
Add payment method button should not jump
Actual Result:
Add payment method button jumps
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.2.65-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
RPReplay_Final1675419094.1.MP4
PQBV3788.MP4
Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1675419194137479
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: