This is a migrated thread and some comments may be shown as answers.

RadMasketTextInput deletes first character

4 Answers 61 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Ádám
Top achievements
Rank 1
Ádám asked on 20 Jul 2017, 10:24 AM

Hi there!

 

I just found an issue with RadMaskedTextInput that is present in the newest WPF Demos, too. In my scenario, I tried it with no mask. Simply type some word into the control, select all with CTRL+A, then hit a letter on the keyboard followed by a space. If you fast enough (but you should not be so fast, just something like experienced-typewriter-fast) your letter will be overwritten by the whitespace that followed it.

 

If you can't reproduce the issue, I can post a video about it.

 

Best Regards

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 25 Jul 2017, 08:54 AM
Hello Ádám,

Thank you for reporting this. We've logged it in our feedback portal and we also updated your telerik account points.
As a workaround, you can try subscribing for PreviewKeyDown like so:
private void RadMaskedTextInput_PreviewKeyDown(object sender, KeyEventArgs e)
       {
           if (this.input.Value != null && this.input.SelectionLength == this.input.Value.Length && this.input.SelectionLength > 0)
           {
               this.input.ClearCommand.Execute(null);
           }
       }



Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Ádám
Top achievements
Rank 1
answered on 26 Jul 2017, 06:45 AM

Hey Petar,

 

It seems to work with your workaround. :) Thanks!

 

Regards,

Ádám

0
Ádám
Top achievements
Rank 1
answered on 26 Jul 2017, 12:46 PM

Hi Petar,
Sorry, it's still not okay. The original issue is gone, but with your workaround if I select the whole text then I press Return (or anything including the modifier keys) the text will be cleared.

Best Regards

0
Petar Mladenov
Telerik team
answered on 28 Jul 2017, 07:14 AM
Hello Ádám,

Thanks for this note. I guess inheritance will do a better job:
public class CustomInput : RadMaskedTextInput
   {      
       protected override void OnKeyDown(KeyEventArgs e)
       {
           if (this.Value != null && this.SelectionLength == this.Value.Length && this.SelectionLength > 0)
           {
               this.ClearCommand.Execute(null);
           }
           base.OnKeyDown(e);
       }       
   }



Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Ádám
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Ádám
Top achievements
Rank 1
Share this question
or