diff --git a/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask/TextBoxMask.cs b/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask/TextBoxMask.cs index 2a897b2fdea..aa326e6b33d 100644 --- a/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask/TextBoxMask.cs +++ b/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask/TextBoxMask.cs @@ -300,7 +300,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve // case adding data at the end of the textbox if (oldSelectionStart >= oldText.Length && !isDeleteOrBackspace) { - textbox.Text = oldText; + textbox.Text = textbox.Text.Substring(0, oldText.Length); if (oldText.Length >= 0) { textbox.SelectionStart = oldText.Length; @@ -327,6 +327,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve if (string.IsNullOrEmpty(textbox.Text)) { textbox.Text = displayText; + return; } else {