Announcement

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

    masking problems

    We are experiencing some problems with MaskedTextItem (which we had adapted before it was officially added to SmartClient) and notice two issues in IE8 (Firefox is fine). Since your masked text item is an offset of MaskedTextItem maybe it is the same issue that we are having which we can reproduce as a standalone.


    Issue #1
    1. Type "abcde" in the first name field.
    2. Press backspace continuously. You'll notice that at some point the selection range had skipped over one of the characters. So now the last letter is left.


    Issue #2

    1. Type "abcde" in the first name field.
    2. Press Ctrl+Z. It does not undo what I have typed.

    If you try both scenarios in the State field it is fine.

    Code:
    
    isc.DynamicForm.create({
        width: 400,
        fields: [
            { name: "firstName", title: "First name", type: "text",
              mask: ">?<??????????????", hint: "&gt;?&lt;??????????????"},
            { name: "state", title: "State", type: "text"
              }    ]
    });

    #2
    This is an issue in 8.2 branch as well

    Comment


      #3
      Any word on this?

      Comment


        #4
        Issue #1 is now resolved in the framework.
        On Issue #2, we see the problem and are looking into possible solutions

        Comment


          #5
          We've done some investigation into #2 and it comes down to a native browser issue that makes "undo" pretty much unsupportable with masking in IE.

          In short the masking logic requires us to programmatically set the value of the text field and the cursor insertion point in response to keypress events.
          How the native "undo" feature handles this is basically out of our hands (and varies by browser). In IE and Chrome, it appears that since the changes to the form item were set via code rather than directly updated by the user's typed keystrokes, "undo" just ignores them.

          We're not seeing any straightforward way to work around this native behavior. In theory, we could do something like intercept the ctrl+z keypress but this would require us to somehow track a history of previous states of the item (both backwards and forwards to support "shift+ctrl+z" for "redo" as well). This would be a huge amount of work to get right and maintain and quite prone to odd edge cases and errors - a route we'd rather not pursue.

          Also, while there is an HTML 5 'onundo' event for recent browsers, in IE8 we'd be limited to reacting to actual keypress events -- so even if we made this change, we wouldn't be notified of attempts to "undo" via the native browser menu, etc., so in that case undo would be broken.

          So unfortunately this looks like a "wont-fix" at least for now.

          Comment

          Working...
          X