Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Backspacing a Dynamic form field value with mask

    I have encountered an issue in IE where all characters are not being deleted when a user holds down the backspace key to remove values from a dynamic form field that has a mask applied. It seems after the first few characters are removed the second one deleted reappears back on the end of the string past the cursor.

    This behavior is seen in SmartClient 8.0 and 8.1 LGPL against IE 8.0.6001.1870 (and others).

    A simple snippet that reproduces the issue is shown below. To see the issue, this snippet can be pasted into any of the Examples pages, fill in the field with numbers, put your cursor between the last two numbers (right most), and hold down the backspace key. There should be one number left in the field, but instead there are two. It is worth noting that if you use a long string of characters and do this multiple times there will be a character added for each time you hold down backspace key to perform the delete.
    Code:
    isc.DynamicForm.create({
        fields: [
            {name: "test",
             title: "Test",
             type: "text",
             width: 100,
             mask:"999999999999999"
           }
        ]
    });
    Does anyone know of a workaround or some settings that can be applied to force deletion of all characters?

    #2
    Any word on how to get around this or a potential fix? Recent tests on Pro 8.1.x 12/14 nightly as well as the Smartclient online examples pages continues to display the issue.

    Thanks

    Comment


      #3
      I didn't realize someone else had reported this almost two months ago. I asked for this to be looked at as well a couple of days ago.

      Comment


        #4
        We've actually recently found and fixed the cause of this in our mainline codebase.
        A patch has been added to the 8.2.x branch as well now, so this issue should be resolved in nightly builds on that branch going forward

        Regards
        Isomorphic Software

        Comment


          #5
          Are you able to tell me what the problem was? As mentioned in my other post, we do not use your mask control but MaskedTextItem but we saw the same behaviour

          Comment


            #6
            The fix should work for a separate form item as well. It was in the EventHandler code, rather than in the masked TextItem itself.

            In short, in IE there is no native "keyPress" event generated for non character keys, so to get consistent key event handling for all keys, cross browser, we have to catch this case and fire the SmartClient "keyPress" event in response to keyDown.
            There was a logic hole in the case where the user pressed and held the backspace key whereby we'd basically fail to react to one of the native keyDown events causing the logic to update the masked characters / reset the cursor insertion position to get off by one character.

            Comment


              #7
              ok thanks. I'll try in the next build

              Comment


                #8
                Still a problem in FireFox Developer Edition 80.0b5 (latest)

                Using the Isomorphic sample for masked entry (https://www.smartclient.com/smartcli...skedTextItem):
                Enter a value in the phone number field (e.g., 8885551234 - appears as (888) 555-1234)
                From the end of the field, start backspacing. Instead of the '4' being deleted, the '3' is deleted and the '4' carries over to where '3' was: (888)555-124_
                Backspace again, and the '12' is removed (two digits) and is replaced by another '4': (888)555-44__
                Backspace again and it works properly - one '5' is removed: (888)554-4___
                Backspace again, and it deletes 2 '5's and adds another '4': (888)444
                Etc.

                This is a problem whether using mask characters ('(', ')', etc.) or not.

                Works fin in the new MS Edge browser.

                Comment


                  #9
                  Hi Isomorphic,

                  I just tested out of interest. This is happening for me as well in the v12.0p_2020-08-08 sample using FF78, fine in Chromium 84.

                  Best regards
                  Blama

                  Comment

                  Working...
                  X