Announcement

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

    Backspace Misbehaves On Masked TextItem In Safari And Chrome

    I'm seeing the following behavior in Safari 5.1.7 and Chrome 21.0.1180.89m on Windows7. IE 8 and Firefox 11 do not have this problem.

    I can enter appropriate values into a masked TextItem. But when I try to backspace them out, only the last character is removed. If I place the cursor anywhere other than after the value, the backspace key behaves like the delete key (removes the char following the cursor).

    Steps to recreate the problem:
    1. Have a TextItem that is masked to allow the input of 6 digits
    2. Enter "123456". Value appears.
    3. Hit backspace. "6" is removed.
    4. Hit backspace again. Nothing is removed.
    5. With either the mouse or keyboard, position the cursor between the "2" and the "3".
    6. Hit backspace. The "3" is removed, not the "2".

    Sample code:
    Code:
    DynamicForm aForm = new DynamicForm();
    TextItem notMasked = new TextItem();
    notMasked.setTitle("Not Masked");
    TextItem isMasked = new TextItem();
    isMasked.setTitle("Masked");
    isMasked.setMask("######");
    isMasked.setMaskPromptChar("");
    aForm.setFields(notMasked, isMasked);
    mainLayout.addMember(aForm);
    mainLayout is simply a VLayout. It doesn't matter whether I setMaskPromptChar(""), but this illustrates my typical usage.

    I'm using SmartGWT EE 3.1d nightly build from 9/11/2012, which reports the following on the console:
    SNAPSHOT_v8.3d_2012-09-11/Enterprise Deployment (built 2012-09-11)

    I have reports of the same behavior in Safari 5.1.7 on Mac OS X 10.6.8.

    Is this a known issue? Is there a workaround?

    Thanks.

    #2
    We've just fixed this if you'd like to check the next nightly SC 8.3d/SGWT 3.1d builds.

    Comment


      #3
      I'm seeing similar behavioral problems on masked TextItem using Firefox 68.0

      Lets follow similar steps to recreate the problem as above:

      FOR BACKSPACE:
      1. Have a TextItem that is masked to allow any character or space
      2. Enter "TESTING". When entering there are no problems.
      3. Hit backspace once. "N" is removed. ("G" should have been removed)
      4. Place cursor after "G" and hit backspace again. "I" is removed ("G" should have been removed!!)
      5. I you continue putting the cursor after "G" and hit backspace, eventually all letters are removed (and "G" is left for the end which can finally be removed)
      6. If however you don't move your cursor to the end each time, there is a different behavior. Enter "TESTING" and have your cursor after "G".
      7. Hit backspace once. "N" is removed. Hit backspace again. "T" is removed and a "G" is added in the end (looks like this: "TESGG"). Hit backspace again "E" and "S" are removed and a "G" is added (looks like "TGGG")

      FOR DELETE:
      Do steps 1 and 2.
      3. place your cursor at the beginning (before the first "T") and hit delete once. the first "T" is removed as well as the "E". Additionally it has added a "G" at the end. (looks like this: "STINGG")
      4. place your cursor at the beginning (before the "S") and hit delete once. "ST" are removed and a "G" is added in the end. (looks like this: "INGGG")
      5. place your cursor at the beginning (before the "I") and hit delete once. "IN" are removed and "G" is added in the end. (looks like this: "GGGG")
      6. place cursor at beginning and hit delete once. Only one "G" is removed and nothing extra added. Hit delete again, one "G" is removed nothing extra added. Finally two more deletes and it's all gone!

      UNDERSCORE:
      I'm not sure about this, but it doesn't seem to allow me to enter an underscore. "_". Is this a special character? (even when removing the mask, it still won't allow me to enter an underscore in the TextItem)

      My MainLayout is simply a VLayout (just like jeffwangler , my code is similar to what he has posted (but with a different mask)).

      I downloaded Smart GWT LGPL Edition (latest nightly)
      SC version: v12.0p_2019-07-11

      and tested with this and the same problems exist.

      Is this a known issue?

      Comment

      Working...
      X