RadLikeWhoa / Countable

Add live paragraph-, word- and character-counting to an HTML element.
https://sacha.me/Countable
MIT License
1.64k stars 134 forks source link

Fix behaviour in textareas that have predefined innerText #15

Closed bensmithett closed 11 years ago

bensmithett commented 11 years ago

In this example...

<textarea>foo</textarea>

counter.all returns 3 when a user deletes everything from the textarea (expect it to return 0)

In the old orig assignment an empty string is evaluating to false so it moves on to the next option, this.element.innerText

RadLikeWhoa commented 11 years ago

Nice, good catch.