Skip to content

Commit 50096b3

Browse files
authored
Merge pull request #34 from diptopol/bugfix/fix-max-count-error
Fixed maximum error text occurance
2 parents 5a2b85d + 070f851 commit 50096b3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

textcounter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@
8383
}
8484

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

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

textcounter.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)