RadMasketTextInput deletes first character

5 posts, 0 answers
  1. Ádám
    Ádám avatar
    3 posts
    Member since:
    Jul 2017

    Posted 20 Jul Link to this post

    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

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2986 posts

    Posted 25 Jul Link to this post

    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.
  3. Ádám
    Ádám avatar
    3 posts
    Member since:
    Jul 2017

    Posted 26 Jul Link to this post

    Hey Petar,

     

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

     

    Regards,

    Ádám

  4. Ádám
    Ádám avatar
    3 posts
    Member since:
    Jul 2017

    Posted 26 Jul Link to this post

    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

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2986 posts

    Posted 28 Jul Link to this post

    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.
Back to Top