Description
The form-validation.md
file of the Cookbook states on line 289 that "there is a bug with this feature such that when the value is blank, it turns back into a string" refering to the fact that the .number
modifier doesn't converts empty strings to number. Then again on line 329 it's refered as a bug. It's really annoying to see an oficial text refering to something as a bug!
Considering that a +''
returns 0
, maybe the current modifier behavior is really misleading. But considering that the .number modifier documentation states that "if the value cannot be parsed with parseFloat(), then the original value is returned" and that parseFloat('')
returns NaN
, I believe that the current behavior of the modifier is the intended behavior, so the form-validation.md
is incorrect.
So, should we correct the wrong affirmative in cookbook/form-validation.md
? And there is any improvement on guide/forms.md
to better clarify that the current behavior is the intended behavior?