Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-1476

TrackChanges: JS Error when replacing a character in certain cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • translate5 - 3.0.0
    • None
    • TrackChanges
    • Reproduced with Chrome. Others not tested.

    Description

      problem

      • The typed character is inserted at the wrong place, see screenshot.
      • A JS Error occurs:
        Uncaught Error: Range error: Range is not valid. This usually happens after DOM mutation. Range: ([WrappedRange(<SPAN>[index:0,length:0][[innerHTML not supported]]:1, <SPAN>[index:0,length:0][[innerHTML not supported]]:2)])

      JS trace

      at assertRangeValid (rangy-core.js:1357)
      at WrappedRange.getNodes (rangy-core.js:1751)
      at constructor.addTrackchangeForDel (UtilDeletion.js?_dc=1542697815499:355)
      at constructor.<anonymous> (UtilDeletion.js?_dc=1542697815499:234)
      at Object.each (ext-all-debug.js:3117)
      at constructor.deleteAllNodesForDel (UtilDeletion.js?_dc=1542697815499:226)
      at constructor.handleDeletion (UtilDeletion.js?_dc=1542697815499:93)
      at constructor.trackChangesInEditor (Editor.js?_dc=1542697813981:543)
      at constructor.handleKeyDown (Editor.js?_dc=1542697813981:327)
      at constructor.fire (ext-all-debug.js:20731)
      assertRangeValid @ rangy-core.js:1357
      getNodes @ rangy-core.js:1751
      addTrackchangeForDel @ UtilDeletion.js?_dc=1542697815499:355
      (anonymous) @ UtilDeletion.js?_dc=1542697815499:234
      each @ ext-all-debug.js:3117
      deleteAllNodesForDel @ UtilDeletion.js?_dc=1542697815499:226
      handleDeletion @ UtilDeletion.js?_dc=1542697815499:93
      trackChangesInEditor @ Editor.js?_dc=1542697813981:543
      handleKeyDown @ Editor.js?_dc=1542697813981:327
      fire @ ext-all-debug.js:20731
      fire @ ext-all-debug.js:34336
      doDirectEvent @ ext-all-debug.js:34417
      onDirectEvent @ ext-all-debug.js:34380
      (anonymous) @ ext-all-debug.js:6862

      reproduction

      • import attached task
      • open the segment for editing
      • place the curser between "d" and "e" of the word "de".
      • press "DEL" to delete the "e" and immediately after that the key "e" to insert the e again.
      • Results are described above

       

      Attachments

        Activity

          People

            Ines-Paul Ines-Paul Baumann (Inactive)
            tlauria Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: