-
Notifications
You must be signed in to change notification settings - Fork 27.5k
password input fields inconsistant with angular values #8230
Comments
@caitp mind taking a look at this one? |
I think the solution to ~~ Issue 1 ~~ is really just "use ng-trim=false", but I can't actually reproduce the second issue at all. "1 1" with or without ng-trim=false will still have a length of 10 (not 3), and the model value won't be "1 1" (it's not clear why it would be expected to be, trimming whitespace only removes leading and trailing whitespace, not interior whitespace) I think this actually works as expected here |
@zeus3rd can you please provide an actual reproduction to show the issue you're having? thanks |
After further investigation, seems Issue 2 is an expected result of using {{}} to display text. However issue 1 is still valid as my example below shows: |
you're using |
Anyways, it may be bad that it's the default behaviour for password inputs --- I guess we could change the behaviour of |
I'm not sure what others would think about that change, but I can implement that. |
Do not trim input[type=password] values BREAKING CHANGE: Previously, input[type=password] would trim values by default, and would require an explicit ng-trim="false" to disable the trimming behaviour. After this CL, ng-trim no longer effects input[type=password], and will never trim the password value. Closes #8250 Closes #8230 Conflicts: src/ng/directive/input.js
~~ Issue 1 ~~
While writing a simple login window I've noticed that adding trailing spaces to password input fields causes the data stored in angular to only trim the stored value, but not correct the HTML5 input field.
for example, typing = "1" (replacing _ with spaces)
will result in the ng-model value being = "1"
but the field visible to the user will show "●●●●●●●●●●●●●●●●●"
Which is inconsistent and misleading to a user
~~ Issue 2 ~~
A different (but likely related) bug I've found is that repeating spaces within the password produces inconsistency in the stored data and it's variable itself
for example, typing = "1________1" (replacing _ with spaces)
will result in the ng-model value being = "1_1" (replacing _ with spaces)
but the ng-model ".length" attribute will be "10", not the expected "3"
The text was updated successfully, but these errors were encountered: