Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -327,6 +327,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
if (string.IsNullOrEmpty(textbox.Text))
{
textbox.Text = displayText;
return;
}
else
{
Expand Down