Merge pull request #2424 from woocommerce/PCP-3156-fastlane-strip-empty-spaces-from-email-to-trigger-profile-lookup

AXO: Add whitespace stripping on submission (3156)
This commit is contained in:
Danny Dudzic 2024-08-01 23:09:29 +02:00 committed by GitHub
commit 0e401e25af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -709,6 +709,8 @@ class AxoManager {
}`
);
this.emailInput.value = this.stripSpaces( this.emailInput.value );
this.$( this.el.paymentContainer.selector + '-detail' ).html( '' );
this.$( this.el.paymentContainer.selector + '-form' ).html( '' );
@ -1134,6 +1136,10 @@ class AxoManager {
return emailPattern.test( value );
}
stripSpaces( str ) {
return str.replace( /\s+/g, '' );
}
validateEmail( billingEmail ) {
const billingEmailSelector = document.querySelector( billingEmail );
const value = document.querySelector( billingEmail + ' input' ).value;