document.onkeydown fired when searching for links in Firefox

J

Jacob Friis Larsen

Courtesy RobB I have the below so a user can use my shortcut keys in
forms, but if a user using Mozilla Firefox press ' to search for links,
my shortcut keys are activated if used. This also happens in Gmail.
Is this a bug?

document.onkeydown = function (e) {
var tgt = null;
if ((e = e || window.event) //get event object
&& (tgt = e.target || e.srcElement) //get trigger element
&& tgt.type //has 'type' property?
&& /text/.test(tgt.type)) //'text' or 'textarea'?
return true; //end processing
}

Thanks,
Jacob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top