Mask rules can be violated with left arrow

2 posts, 0 answers
  1. Terry
    Terry avatar
    1 posts
    Member since:
    Jul 2013

    Posted 11 Mar 2015 Link to this post

    http://dojo.telerik.com/etIwa/2


    <input id="maskedtextbox" />

    <script>
    var m = "0ba";
    // this should limit the first character to 0-9, the second to 0-5, and the third to 0-2
    // but enter the following:
    // 9
    // left arrow
    // 2
    // left arrow
    // 3
    // left arrow
    // 8
    // left arrow
    // 9
    // leaves us with "983" - only the first character is "valid"
    // basically, after you left arrow it will "push" the existing characters to the right (sometimes, not always) when the next character is entered

    $("#maskedtextbox").kendoMaskedTextBox({
    mask: m,
        rules: {
          // "0" allows 0-9
          "b": function (char) {
            return (char === "0" || char === "1" || char === "2" || 
                        char === "3" || char === "4" || char === "5");
          },
          "a": function (char) {
            return (char === "0" || char === "1" || char === "2");
          }
        }
    });
    </script>
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 16 Mar 2015 Link to this post

    Hello Terry,

    Thank you for drawing our attention to this issue. Currently, widget just pushes the rest of the input to the right, instead of validating the newly created value. I logged this erroneous behavior for further investigation and fix.

    As a gratitude for your involvement I updated your Telerik points.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top