Skip to content
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

IE11 user login email validation fails if field has leading or trailing space #6058

Closed
dnadle opened this issue Aug 8, 2016 · 21 comments
Closed
Assignees
Labels
Area: Frontend bug report Event: dmcdindia Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@dnadle
Copy link

dnadle commented Aug 8, 2016

Preconditions

  1. Magento 2.1.0
  2. IE11 browser
  3. Chrome 51 browser

Steps to reproduce

  1. Attempt login using IE with a valid user email but place a space either before or after the address.
  2. Try again with Chrome.

Expected result

  1. Client-side email validation should work the same in IE11 as it does in Chrome.

Actual result

  1. Using IE, client-side validation fails with "Please enter a valid email address (Ex: johndoe@domain.com)."
  2. Using Chrome, login succeeds. (padded whitespace is presumably trimmed?)
@dnadle
Copy link
Author

dnadle commented Aug 9, 2016

I received a report that Firefox behaves like IE11.

@magentodevleper
Copy link

Magento 2.1.0 also having same problem

@AVoskoboinikov AVoskoboinikov self-assigned this Aug 26, 2016
@AVoskoboinikov AVoskoboinikov added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 26, 2016
@AVoskoboinikov
Copy link
Contributor

Hi guys

Thanks for reporting this issue. I have created internal ticket MAGETWO-57657 to fix it

@AVoskoboinikov AVoskoboinikov removed their assignment Aug 31, 2016
@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Customer Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 6, 2017
@magento-engcom-team
Copy link
Contributor

@dnadle, thank you for your report.
We've created internal ticket(s) MAGETWO-57657 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 6, 2017
@mtbottens
Copy link

This is caused by browser inconsistencies in element.value. Per the spec, email inputs should trim leading and trailing whitespace. Chrome is doing this properly while ie11 (surprise) is not.

See spec here: https://www.w3.org/TR/html5/forms.html#e-mail-state-(type=email)

Code example:

(function(document) {
    var input = document.createElement('input');
    input.type = 'email';
    input.value = ' test@example.com';
    console.log(input.value.indexOf(' ')); // -1 in chrome, 0 in IE
})(document)

@orlangur
Copy link
Contributor

@mtbottens as I understand we cannot fix validation introduced by browser itself?

Such browser-specific validation could be disabled but I don't think it's a good idea.

@mtbottens
Copy link

@orlangur Essentially. No matter what we do, the browser is still going to return the value with the leading/trailing white space trimmed. The only thing we could really do is write a method to get the value which would handle trimming the whitespace for email inputs to support browsers which aren't following the spec. But doing that would require us overwriting logic in $.fn.validate, specifically the elementValue method.

I personally believe this should just be filed away as progressive enhancement and nothing should be done about it, but I suppose that is a decision left to Magento.

@dnadle
Copy link
Author

dnadle commented Oct 24, 2017

You could add a validation for whitespace prior to the one for invalid email, so the validation error is meaningful and the user understands what is wrong.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Jun 5, 2018
@magento-engcom-team
Copy link
Contributor

Hi @dnadle. Thank you for your report.
The issue has been fixed in #15365 by @dankhrapiyush in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.6 release.

@sidolov
Copy link
Contributor

sidolov commented Jun 13, 2018

Hi @dnadle. Thank you for your report.
The issue has been fixed in #15874 by @dankhrapiyush in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.15 release.

@sidolov sidolov added the Fixed in 2.1.x The issue has been fixed in 2.1 release line label Jun 13, 2018
@magento-engcom-team
Copy link
Contributor

Hi @dnadle. Thank you for your report.
The issue has been fixed in #15884 by @dankhrapiyush in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jun 13, 2018
@VladimirZaets
Copy link
Contributor

VladimirZaets commented Jun 21, 2018

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16192 by @dankhrapiyush in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.6 release.

@sidolov
Copy link
Contributor

sidolov commented Jun 23, 2018

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16297 by @dankhrapiyush in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.15 release.

@sidolov
Copy link
Contributor

sidolov commented Jun 25, 2018

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16293 by @dankhrapiyush in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team
Copy link
Contributor

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16564 by @dankhrapiyush in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.6 release.

@sidolov
Copy link
Contributor

sidolov commented Jul 11, 2018

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16640 by @gelanivishal in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@VladimirZaets
Copy link
Contributor

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16595 by @gelanivishal in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.6 release.

@VladimirZaets
Copy link
Contributor

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16986 by @gelanivishal in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.15 release.

@magento-engcom-team
Copy link
Contributor

Hi @dnadle. Thank you for your report.
The issue has been fixed in #16956 by @gelanivishal in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

mmansoor-magento pushed a commit that referenced this issue May 11, 2021
[TSG] Fixes for 2.3 (pr144) (2.3.7-develop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend bug report Event: dmcdindia Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests