progress.js
progress.js copied to clipboard
Make the character-limited textarea more intuitive
This solves the problem raised in issue #5. Namely, it:
- Prevents input from exceeding the textarea limit when holding down a key
- Prevents pasting text that would exceed the textarea limit
- Updates the progress bar even when holding down a key
The solution is cross-browser, though very old browsers might not work with it. This should also fix issue #1.
Review welcome.
That's a ton of changes @ConnorKrammer! Could you please provide an online example?
I just looked back on this and realized I could have done this much more simply, so I've updated it accordingly. That's cut down on the changes by a lot.
If you want to see the changes in action, open up my fork's demo page. Keep in mind that I made no changes to progress.js itself, just the demo.
Let me know if there's anything to fix.