Skip to content

Commit

Permalink
Merge pull request #34 from diptopol/bugfix/fix-max-count-error
Browse files Browse the repository at this point in the history
Fixed maximum error text occurance
  • Loading branch information
ractoon authored Jul 30, 2017
2 parents 5a2b85d + 070f851 commit 50096b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion textcounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@
}

if (base.options.max !== -1) { // if a maximum value has been set
if (textCount >= base.options.max && base.options.max !== 0) {
if (textCount === base.options.max && base.options.max !== 0) {
// TextCounter: maxcount(el) Callback
base.options.maxcount(base.el);

} else if (textCount > base.options.max && base.options.max !== 0) {
if (base.options.stopInputAtMaximum) { // if the string should be trimmed at the maximum length
var trimmedString = '';

Expand Down
2 changes: 1 addition & 1 deletion textcounter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 50096b3

Please sign in to comment.