Skip to content

Disable the submit button if required form fields are not filled out#4272

Merged
madmax330 merged 4 commits intomainfrom
jasper-disableSubmitButtonCompanyStep
Jul 30, 2021
Merged

Disable the submit button if required form fields are not filled out#4272
madmax330 merged 4 commits intomainfrom
jasper-disableSubmitButtonCompanyStep

Conversation

@jasperhuangg
Copy link
Copy Markdown
Contributor

@jasperhuangg jasperhuangg commented Jul 28, 2021

Details

See issue for more context.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/171673

Tests/QA

  1. Navigate to the company step in the VBA flow: <baseURL>/bank-account/company.
  2. These are the fields that need to be filled out in order for the "Save & Continue" button to be enabled. Verify that the button is disabled if any of these fields aren't filled out. You don't need to input a valid value, any value will suffice as long as it isn't empty:
    • Legal Business Name
    • Company Address
    • City (for company address)
    • State (for company address)
    • Zip Code (for company address)
    • Company Website
    • Tax ID Number
    • Incorporation Date
    • Industry Classification Code
    • Expensify Password

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

N/A

@jasperhuangg jasperhuangg self-assigned this Jul 28, 2021
@jasperhuangg jasperhuangg marked this pull request as ready for review July 28, 2021 16:36
@jasperhuangg jasperhuangg requested a review from a team as a code owner July 28, 2021 16:36
@MelvinBot MelvinBot requested review from madmax330 and removed request for a team July 28, 2021 16:37
* @returns {Boolean}
*/
validate() {
if (!this.state.password.trim()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave these in?
B/c the button will be disabled, but what if someone hits return or "Done" on mobile or whatever, won't that still submit the form and bypass the button being disabled?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically I don't think we should rely on the button being enabled/disabled as a sign that the input is valid or not.

@jasperhuangg jasperhuangg requested a review from madmax330 July 30, 2021 02:00
@jasperhuangg
Copy link
Copy Markdown
Contributor Author

@madmax330 Thanks so much for the review! I reverted the commit that removed the duplicate checks, should be good for another look!

@madmax330 madmax330 merged commit 69d740a into main Jul 30, 2021
@madmax330 madmax330 deleted the jasper-disableSubmitButtonCompanyStep branch July 30, 2021 10:00
@OSBotify
Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to staging in version: 1.0.81-5🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Copy Markdown
Contributor

OSBotify commented Aug 6, 2021

🚀 Deployed to production in version: 1.0.82-7🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants