-
Type:
Bug
-
Resolution: Fixed
-
None
-
Affects Version/s: None
-
Component/s: TrackChanges
-
Environment:
Google Chrome
-
Emptyshow more show less
problem
- Open a segment with content for editing.
- double click on the editable text to select the whole segment content
- overwrite it with just an x
- double click on the text again so that all text (the old one in DEL tags and the new one) is selected.
- press CTRL+.
- FIRST ERROR: as text is now displayed just an inserted x, nothing is copied from source to target!
- double click on the text again so that all text (the new x only) is selected
- press CTRL+. again
- SECOND ERROR: JS Exception
Exception
Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': Only one element on document allowed.
at constructor.moveNodeOneLevelUp (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilNode.js?_dc=1523458193074:116:25)
at constructor.addInsForContentByRange (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/UtilInsertion.js?_dc=1523458193074:211:20)
at constructor.handleAfterInsertMarkup (http://translate5.localdev/editor/plugins/js/TrackChanges/controller/Editor.js?_dc=1523458192491:425:12)
at constructor.fire (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:20731:42)
at constructor.dispatch (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:57952:48)
at constructor.callParent (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:12493:32)
at constructor.dispatch (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:58196:21)
at constructor.prototype.doFireEvent (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:58109:30)
at constructor.fireEventArgs (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:21553:26)
at constructor.fireEvent (http://translate5.localdev/ext-6.2.0/build/ext-all-debug.js:21512:25)
solution
- added: before we insert markup (eg via CTRL+.), we run the TrackChanges on the selected content that will be overwritten
- fixed: inserting after selecting the complete content works now, also for CTRL+.
- fixed: when content is inserted after everything has been selected (and "replaced" after the insert), the content will always be inserted at the end