Coder Social home page Coder Social logo

Comments (3)

jnizet avatar jnizet commented on April 28, 2024 1

Just a note: this seems to be specific to inputs of type "email". If the type of the input is "text", the space is present in the input value.
And this happens in both Chrome and Fireforx

from angular.

alxhub avatar alxhub commented on April 28, 2024 1

This is a super weird case, for sure.

from angular.

alexkunin avatar alexkunin commented on April 28, 2024 1

Let me add some context to this, guys.

According to HTML specs of type=email (this is for non-multiple mode; multiple also has similar behavior, a bit different tho):

The value sanitization algorithm is as follows: Strip newlines from the value, then strip leading and trailing ASCII whitespace from the value.

When value sanitization algorithm is applied (there are some other cases on that page too, but this one is most relevant):

When the value content attribute is added, set, or removed, if the control's dirty value flag is false, the user agent must set the value of the element to the value of the value content attribute, if there is one, or the empty string otherwise, and then run the current value sanitization algorithm, if one is defined.

So, basically, as with type=number etc., best way to handle this is to avoid using anything other than type=text (with notable password, radio, file etc. exceptions).

Not 100% sure, but maybe specialized ControlValueAccessor for input[type=email][formControlName] etc. is the correct way to resolve this?

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.