Skip to content

Commit

Permalink
fix(createTextMask): fixes backspace not controlling caret position c…
Browse files Browse the repository at this point in the history
…orrectly on some cases

re #27
  • Loading branch information
renato-bohler committed May 5, 2018
1 parent 2efc31a commit 4efad32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/createTextMask.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export default options => {
backspace to move the caret accordingly */
if (
value.length === previousValue.length + 1 &&
!charMatchTest(value.charAt(previousSelection), maskDefinitions)
value.charAt(previousSelection) ===
pattern.charAt(previousSelection)
) {
// Backspace was pressed at a pattern char
goToNearestValidPosition(target, previousSelection, 'left');
Expand Down

0 comments on commit 4efad32

Please sign in to comment.