mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 23: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 ()
|
unselectText: function ()
|
||||||
{
|
{
|
||||||
let elem = window.document.commandDispatcher.focusedElement;
|
let elem = window.document.commandDispatcher.focusedElement;
|
||||||
if (elem && elem.selectionEnd)
|
// A error occurs if the element has been removed when "elem.selectionStart" is executed.
|
||||||
elem.selectionEnd = elem.selectionStart;
|
try {
|
||||||
|
if (elem && elem.selectionEnd)
|
||||||
|
elem.selectionEnd = elem.selectionStart;
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
},
|
},
|
||||||
|
|
||||||
selectedText: function ()
|
selectedText: function ()
|
||||||
|
|||||||
Reference in New Issue
Block a user