diff --git a/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxRegEx/TextBoxRegex.cs b/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxRegEx/TextBoxRegex.cs index 082450754cf..e0d0cb5e277 100644 --- a/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxRegEx/TextBoxRegex.cs +++ b/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxRegEx/TextBoxRegex.cs @@ -105,7 +105,7 @@ private static void ValidateTextBox(TextBox textbox, bool force = true) { if (validationModel == ValidationMode.Dynamic) { - int selectionStart = textbox.SelectionStart - 1; + int selectionStart = textbox.SelectionStart == 0 ? textbox.SelectionStart : textbox.SelectionStart - 1; textbox.Text = textbox.Text.Remove(selectionStart, 1); textbox.SelectionStart = selectionStart; }