When hitting backspace on an empty input box I was getting "Uncaught TypeError: Cannot read property 'offsetLeft' of undefined" on line 166. So I'm checking charsToRemove for length now.
I also added a parameter called "dest" and a function called "destroy" that let you remove all events. This was needed for a project where fancyInput had to be initialized and de-initialized regularly. Without this, the key events were duplicating, causing characters to be typed multiple times because the events are assigned to the document. So simply setting a parameter to true clears the events immediately, like this:
...a destroy parameter to clear events.
When hitting backspace on an empty input box I was getting "Uncaught TypeError: Cannot read property 'offsetLeft' of undefined" on line 166. So I'm checking charsToRemove for length now.
I also added a parameter called "dest" and a function called "destroy" that let you remove all events. This was needed for a project where fancyInput had to be initialized and de-initialized regularly. Without this, the key events were duplicating, causing characters to be typed multiple times because the events are assigned to the document. So simply setting a parameter to true clears the events immediately, like this:
$someInput.fancyInput(true);