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

TrackChanges: Select a word with double click then type new text produces JS error and wrong track changes

    XMLWordPrintable

Details

    Description

      problem

      JS error and wrong trackchanges (see screenshot) on rewriting a segment with a single word.

      The track changes are
      <del>Startseitea</del><ins>sd</ins>
      but should be
      <del>Startseite</del><ins>asd</ins>

      steps to reproduce

      1. open a segment which contains only one word
      2. select the word by double click
      3. type new text (asd in the screen shot)

      trace

      rangy-core.js:2304 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=1544611956543:377:19)
      at constructor.getContainerForCharacterNextToCaret (http://translate5.localdev/modules/editor/js/app/util/Range.js?_dc=1544611956543:174:35)
      at constructor.getTrackchangeNodeForContentBeforeCaret (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilRange.js?_dc=1544611957036:220:34)
      at constructor.getINSNodeForContentBeforeCaretAccordingToEvent (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilRange.js?_dc=1544611957036:242:34)
      at constructor.handleInsert (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilInsertion.js?_dc=1544611957036:111:40)
      at constructor.trackChangesInEditor (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/Editor.js?_dc=1544611956448:552:37)
      at constructor.handleKeyDown (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/Editor.js?_dc=1544611956448: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)

      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: