From 24028d8ad3ad94ba7af4d71ca5e2351ffcae47c2 Mon Sep 17 00:00:00 2001 From: Jerry Smith Date: Tue, 16 Oct 2018 17:13:04 +0300 Subject: [PATCH] Fix #243 --- src/mask.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mask.js b/src/mask.js index 1f738ab..44b8df1 100644 --- a/src/mask.js +++ b/src/mask.js @@ -520,6 +520,7 @@ angular.module('ui.mask', []) function keydownHandler(e) { /*jshint validthis: true */ + oldSelectionLength = getSelectionLength(this); var isKeyBackspace = e.which === 8, caretPos = getCaretPosition(this) - 1 || 0, //value in keydown is pre change so bump caret position back to simulate post change isCtrlZ = e.which === 90 && e.ctrlKey; //ctrl+z pressed