Skip to content

Commit 1a28ca7

Browse files
Merge branch 'master' into gazeCS
2 parents 91c8704 + 31bf71f commit 1a28ca7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask/TextBoxMask.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
300300
// case adding data at the end of the textbox
301301
if (oldSelectionStart >= oldText.Length && !isDeleteOrBackspace)
302302
{
303-
textbox.Text = oldText;
303+
textbox.Text = textbox.Text.Substring(0, oldText.Length);
304304
if (oldText.Length >= 0)
305305
{
306306
textbox.SelectionStart = oldText.Length;
@@ -327,6 +327,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
327327
if (string.IsNullOrEmpty(textbox.Text))
328328
{
329329
textbox.Text = displayText;
330+
return;
330331
}
331332
else
332333
{

0 commit comments

Comments
 (0)