From 9fb7a89a6019a037eb7fe008fcede244becb1080 Mon Sep 17 00:00:00 2001 From: Alexandros Georgantas <alexgeorg86@gmail.com> Date: Thu, 23 Feb 2017 18:28:39 +0200 Subject: [PATCH] - Track Change provider in selection plus one setSelection is needed --- .../elements/track_change/TrackChangesProvider.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/SimpleEditor/elements/track_change/TrackChangesProvider.js b/app/components/SimpleEditor/elements/track_change/TrackChangesProvider.js index 678c3a6..35298b3 100644 --- a/app/components/SimpleEditor/elements/track_change/TrackChangesProvider.js +++ b/app/components/SimpleEditor/elements/track_change/TrackChangesProvider.js @@ -805,8 +805,6 @@ class TrackChangesProvider extends TOCProvider { // TODO -- use substance's selection.collapse(direction) if (point === 'start') { - selection.start.offset -= 1 - selection.end.offset -= 1 selection.end.offset = selection.start.offset } else if (point === 'end') { selection.start.offset = selection.end.offset @@ -820,10 +818,13 @@ class TrackChangesProvider extends TOCProvider { setSelectionPlusOne (direction) { const selection = this.getSelection() + const surface = this.getSurface() if (direction === 'left') selection.start.offset -= 1 if (direction === 'right') selection.end.offset += 1 + surface.editorSession.setSelection(selection) + return selection } -- GitLab