drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.38k stars 1.62k forks source link

Uncaught TypeError: Cannot set property 'keydown' of undefined in iCheck v2.0.0 RC1 #160

Closed iliajie closed 9 years ago

iliajie commented 10 years ago

If you get onto iCheck ( used with radio) from some other input field using tab key, then you have an error in console. It continues to work properly and throws no more errors afterwards.

If you comment out the following line:

hashes[key].keydown = hashes[lastKey].keydown = false;

Then there is no problem at all.

Why is this really happening?

patstuart commented 10 years ago

I also encountered this bug on key press with JQuery 1.7.2 and JQueryUI 1.10.4.

It occurs because lastKey is undefined.

It occurs in the newest releases of Opera, Chrome, Firefox, and IE.

It does not occur in v1.0.2.

drgullin commented 9 years ago

Thanks @qooob and @patstuart.