RobertWHurst/KeyboardJS — Issue #16: .clear() leaves a hole in keyBindingGroups, breaking functionality
Author: Tidwell
Created: 2012-01-15 21:29:07+00:00
State: open

It looks like the call to clear() is leaving a hole in the internal keyBindingGroups, preventing any further binds from working correctly and throwing the following error/stack:

Uncaught TypeError: Cannot read property 'keys' of undefined
queryActiveBindingskeyboard.js:161
pruneActiveKeyBindingskeyboard.js:248
bindingStackkeyboard.js:139

due to:
281: delete keyBindingGroups[keys.length][index];

I tested locally replacing the delete call with a call to Resig's array.remove implementation and it seemed to fix the issue.

eample:
http://jsfiddle.net/KEAfs/