Skip to content

Commit d851152

Browse files
committed
[UPDATE] fixing case change due to Text property is cleared by binding
1 parent f288704 commit d851152

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Text;
88
using System.Text.RegularExpressions;
9+
910
using Windows.ApplicationModel.DataTransfer;
1011
using Windows.UI.Xaml;
1112
using Windows.UI.Xaml.Controls;
@@ -295,6 +296,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
295296
deleteBackspaceIndex++;
296297
}
297298
}
299+
298300
}
299301

300302
// case adding data at the end of the textbox
@@ -327,6 +329,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
327329
if (string.IsNullOrEmpty(textbox.Text))
328330
{
329331
textbox.Text = displayText;
332+
return;
330333
}
331334
else
332335
{
@@ -340,7 +343,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
340343

341344
if (!isDeleteOrBackspace)
342345
{
343-
// Case change happended due to user input
346+
// Case change happened due to user input
344347
var selectedChar = textbox.SelectionStart > 0 ?
345348
textbox.Text[textbox.SelectionStart - 1] :
346349
placeHolder;

0 commit comments

Comments
 (0)