Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1341

quick typing sometimes produces a reversed order string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.9.2
    • 3.9.1
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      1. quick typing "12"

      Current Result

      Sometimes ZSS reverses (transpose) each digits, so the result is 21 instead of 12

      Expected Result

      "12" as the typing order

      Debug Info

      • since we call placeCaretAtEnd() in setTimeout(), so there is a minor time delay that users can type the 2nd character before moving the caret to the end. So the resulting character sequence doesn't match the typing sequence. If we increase the timeout time, it's even easier to produce such issue.
                            setTimeout(function() {
                                $edit.focus();
                                //ZSS-1214
                                if (percent) {
                                    placeCaretBeforeEnd(editorcmp);
                                } else {
                                    placeCaretAtEnd(editorcmp);
                                }
                            }, 125);
        
      • check chrome profiling "t4907-chrome-profiling.zip"

      Workaround

      • zss.Editbox.edit(), don't call placeCaretAtEnd() in a setTimeout callback

        1. quckTyping.mp4
          145 kB
        2. quickTypingScreenshots.png
          quickTypingScreenshots.png
          54 kB
        3. t4907.js
          2 kB
        4. t4907-chrome-profiling.zip
          2.07 MB

            henrichen henrichen
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: