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

TrackChanges JS Error: Uncaught DOMException: Failed to execute 'setEnd' on 'Range': There is no child at offset 4.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • translate5 - 3.0.5
    • None
    • TrackChanges
    • Chrome / Linux / version: current master

    Description

      problem

      The JS Exception "Uncaught DOMException: Failed to execute 'setEnd' on 'Range': There is no child at offset 4." happens on pasting content into the segment editor.

      stack trace

      Uncaught DOMException: Failed to execute 'setEnd' on 'Range': There is no child at offset 4.
      at WrappedRange.rangeProto.setEnd (http://translate5.localdev/js/rangy/rangy-master/lib/rangy-core.js:2304:42)
      at constructor.getPositionInfoForRange (http://translate5.localdev/modules/editor/js/app/util/Range.js?_dc=1547557550353:377:19)
      at constructor.getContainerForCharacterNextToCaret (http://translate5.localdev/modules/editor/js/app/util/Range.js?_dc=1547557550353:174:35)
      at constructor.getTrackchangeNodeForContentBeforeCaret (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilRange.js?_dc=1547557550805:220:34)
      at constructor.getINSNodeForContentBeforeCaretAccordingToEvent (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilRange.js?_dc=1547557550805:242:34)
      at constructor.handleInsert (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilInsertion.js?_dc=1547557550805:111:40)
      at constructor.trackChangesInEditor (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/Editor.js?_dc=1547557549748:552:37)
      at constructor.handleKeyDown (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/Editor.js?_dc=1547557549748:327:41)
      at constructor.fire (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:20731:42)
      at constructor.fire (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:34336:27)

       

      steps to reproduce

      1. Copy a text from somewhere
      2. Open A segment for editing
      3. Double click the segment content to select all
      4. press ctrl-v to paste and overwrite the selected content with the copied one
      5. The content is pasted, the selected old content is wrapped with DEL, but the new content is inserted without INS tags!

       

      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: