Skip to content

Commit a1bd243

Browse files
committed
Included password and HTML5 input types in default ignore list
1 parent 0451de1 commit a1bd243

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jquery.hotkeys.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@
3939
}
4040

4141
var origHandler = handleObj.handler,
42-
keys = handleObj.data.toLowerCase().split(" ");
42+
keys = handleObj.data.toLowerCase().split(" "),
43+
textAcceptingInputTypes = ["text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", "datetime-local", "search", "color"];
4344

4445
handleObj.handler = function( event ) {
4546
// Don't fire in text-accepting inputs that we didn't directly bind to
4647
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
47-
event.target.type === "text") ) {
48+
jQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) {
4849
return;
4950
}
5051

0 commit comments

Comments
 (0)