mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:57:59 +01:00
Some 'strictfocus' tweaks.
This commit is contained in:
@@ -735,13 +735,15 @@ const Events = Module("events", {
|
||||
}
|
||||
},
|
||||
|
||||
// TODO: Merge with onFocusChange
|
||||
onFocus: function (event) {
|
||||
function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument
|
||||
|
||||
let elem = event.originalTarget;
|
||||
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
|
||||
|
||||
if (hasHTMLDocument(win) && !buffer.focusAllowed(win))
|
||||
if (hasHTMLDocument(win) && !buffer.focusAllowed(win)
|
||||
&& isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement]))
|
||||
elem.blur();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user