- commit
- e47b5dacbf512c94f78bbe9dda21d8a63e993c6f
- parent
- 798763c75841f82cc846203e5733dfd60c5cf9de
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-05-08 19:17
fix: keep selectionDirection
Diffstat
M | static/pad.js | 3 | ++- |
1 files changed, 2 insertions, 1 deletions
diff --git a/static/pad.js b/static/pad.js
@@ -29,7 +29,7 @@ var sendChanges = utils.throttled(function() { 29 29 30 30 var applyChanges = function(changes) { 31 31 var text = el.value;32 -1 var selection = [el.selectionStart, el.selectionEnd];-1 32 var selection = [el.selectionStart, el.selectionEnd, el.selectionDirection]; 33 33 while (changes.length) { 34 34 text = context.apply(text, changes.shift(), selection); 35 35 } @@ -38,6 +38,7 @@ var applyChanges = function(changes) { 38 38 el.value = text; 39 39 el.selectionStart = selection[0]; 40 40 el.selectionEnd = selection[1]; -1 41 el.selectionDirection = selection[2]; 41 42 requestAnimationFrame(function() { 42 43 el.scrollTop = scrollTop; 43 44 });