mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 16:57:59 +01:00
Escaping the error.
A error occurs if the element has been removed when "elem.selectionStart" is executed. e.g. Press "gi<ESC>" on <input type="text" onfocus="this.parentNode.removeChild(this)" />
This commit is contained in:
@@ -607,8 +607,12 @@ function Editor() //{{{
|
||||
unselectText: function ()
|
||||
{
|
||||
let elem = window.document.commandDispatcher.focusedElement;
|
||||
if (elem && elem.selectionEnd)
|
||||
elem.selectionEnd = elem.selectionStart;
|
||||
// A error occurs if the element has been removed when "elem.selectionStart" is executed.
|
||||
try {
|
||||
if (elem && elem.selectionEnd)
|
||||
elem.selectionEnd = elem.selectionStart;
|
||||
}
|
||||
catch (e) {}
|
||||
},
|
||||
|
||||
selectedText: function ()
|
||||
|
||||
Reference in New Issue
Block a user