mythril / jquery-inputlimiter

3 stars 4 forks source link

allowExceed = true doesn't show negative remaining characters when limit exceeded. #2

Open yourtallness opened 7 years ago

yourtallness commented 7 years ago

Per the documentation:

allowExceed Type: Boolean Default: false

Determines whether the user is allowed to keep entering more characters after they have reached the limit. By default the option stops the user from typing when they reach the limit. If this option is set to true they will be able to type past the limit. When the limited is exceeded the remaining text will display a negative number indicating how many character they are over.

In practice though, anything over the limit will result in 0 remaining characters because of this:

var charsRemaining = (opts.limit - count > 0 ? opts.limit - count : 0),
                remText = opts.remTextFilter(opts, charsRemaining),
                limitText = opts.limitTextFilter(opts);