netceteragroup / valdr

A model centric approach to AngularJS form validation
http://netceteragroup.github.io/valdr/
MIT License
153 stars 43 forks source link

hibernateEmailValidator: also return 'true' for NaN input #96

Closed robert-iddink closed 8 years ago

robert-iddink commented 8 years ago

Ran into this in our project, where the input was NaN at some time.

philippd commented 8 years ago

I think this should only happen if you have an input of type number as your e-mail input field. Which actually does not make sense at all. :) Can you give some details about how you got NaN there?

robert-iddink commented 8 years ago

Thanks for your reply!

Agreed on the type="number" ;-). In our case, the type="email" (hardcoded), so that shouldn't be the cause.

The problem does not occur when we directly open the URL where the form is located (http://localhost:8000/ui/#/user/register).

The problem only happens when we switch from another state to the state with the form (i.e., browse to http://localhost:8000/ui/#/user/login and click 'create user', which navigates to http://localhost:8000/ui/#/user/register).

The input is bound via ng-model to a property of type 'string' (defined in its TypeScript interface).

We're using Angular, angular-ui-router, TypeScript and valdr. I saw it happen both in Chrome and Firefox.

Any ideas?

robert-iddink commented 8 years ago

Any updates on this?

marcelstoer commented 8 years ago

@philippd I'd like to close this as we seem to agree that number types for email input fields is not a legit use case. The real issue appears to be unrelated to valdr and should be handled as a support request. Agree?

robert-iddink commented 8 years ago

Agreed Marcel, the value should never become NaN and if it does, the cause lies somewhere else.