summaryrefslogtreecommitdiffstats
path: root/mousetrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'mousetrap.js')
-rw-r--r--mousetrap.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/mousetrap.js b/mousetrap.js
index 74e7e72..5a56da3 100644
--- a/mousetrap.js
+++ b/mousetrap.js
@@ -156,7 +156,13 @@
* loop through to map numbers on the numeric keypad
*/
for (i = 0; i <= 9; ++i) {
- _MAP[i + 96] = i;
+
+ // This needs to use a string cause otherwise since 0 is falsey
+ // mousetrap will never fire for numpad 0 pressed as part of a keydown
+ // event.
+ //
+ // @see https://github.com/ccampbell/mousetrap/pull/258
+ _MAP[i + 96] = i.toString();
}
/**