Skip to content
This repository was archived by the owner on Nov 8, 2017. It is now read-only.

Only positive maxLength should truncate passwords#30

Open
stephenemslie wants to merge 1 commit intokeithamus:masterfrom
stephenemslie:negative-maxlength-input
Open

Only positive maxLength should truncate passwords#30
stephenemslie wants to merge 1 commit intokeithamus:masterfrom
stephenemslie:negative-maxlength-input

Conversation

@stephenemslie
Copy link

This allows handles negative maxLength in password inputs.

Currently inputs with a negative maxLength will have it's value set to an empty string.

Specifying a negative maxLength should result in the default behavior, which is to allow an unlimited number of characters, the full password in other words.

By limiting maxLength to a minimum of 0, the entire password will be used for values of maxLength less than or equal to 0, while values above 0 use the first maxLength characters of the password.

This allows us to handle negative maxLength in password inputs.

Specifying a negative maxLength results in the default behavior, which
is to allow an unlimited number of characters[1]. By limiting maxLength
to a minimum of 0, the entire password is used for values of maxLength
less than or equal to 0, while values above 0 use the first maxLength
characters of the password.

[1] https://developer.mozilla.org/en/docs/Web/HTML/Element/input
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments