1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 18:14:12 +01:00

Don't feed keys to document.activeElement unless it's an input element. Closes issue #467.

This commit is contained in:
Kris Maglione
2011-03-28 19:53:38 -04:00
parent b485c9d55e
commit c2d2415b1a

View File

@@ -669,12 +669,15 @@ var Events = Module("events", {
let doc = document.commandDispatcher.focusedWindow.document;
let event = events.create(doc, type, evt);
let target = dactyl.focusedElement
|| ["complete", "interactive"].indexOf(doc.readyState) >= 0 && doc.documentElement
|| doc.defaultView;
if (target instanceof Element && !Events.isInputElement(target))
target = target.ownerDocument.documentElement;
if (!evt_obj.dactylString && !mode)
events.dispatch(dactyl.focusedElement
|| ["complete", "interactive"].indexOf(doc.readyState) >= 0 && doc.documentElement
|| doc.defaultView,
event, evt);
events.dispatch(target, event, evt);
else if (type === "keypress")
events.events.keypress.call(events, event);
}