mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 13:47:57 +01:00
Fix pasting bug.
This commit is contained in:
@@ -44,7 +44,9 @@ var Editor = Module("editor", {
|
||||
|
||||
let start = elem.selectionStart; // caret position
|
||||
let end = elem.selectionEnd;
|
||||
elem.value = elem.value.substring(0, start) + text + elem.value.substring(end);
|
||||
let value = elem.value.substring(0, start) + text + elem.value.substring(end);
|
||||
elem.value = value;
|
||||
Editor.getEditor(elem).rootElement.firstChild.textContent = value;
|
||||
elem.selectionStart = Math.min(start + (toStart ? 0 : text.length), elem.value.length);
|
||||
elem.selectionEnd = elem.selectionStart;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user