digitalBush/jquery.maskedinput — pull request #256 by akn102 (2014-10-07 21:13:13+00:00)
Title: Clear buffer when shifting characters to the left

This PR fixes a bug where if you type characters at the end of an input mask with autoclear set to false and then blur/focusout, the typed characters are shifted to the beginning of the mask (left) but then also duplicated at their original typed position... resulting in some wacky entries like "(44_) ___ - __44". Further focusing / blurring on the input field would repeat this strange duplication + shifting issue.

This fix duplicates the solution found in https://github.com/digitalBush/jquery.maskedinput/pull/175 and adds a test.

Now, we're clearing the buffer (removing trailing characters) if your cursor position is greater than the length of your input after the characters have been shifted left.