javascript - select2 overwrites e.preventDefault() -


i've wrote script uses bunch of data , building grid able move through arrowkeys , tab.

while testing in seperate file works fine. after adding website script works pretty in chrome, opera, safari , ie. in firefox focus jumps out of grid , went adressbar. using same data in testfile, there no error this.

what reason why not work in firefox? got no errors in firebug.

its file more 2500 lines...here part navigation tab starts:

    $(document).keydown(function (e) {                 switch (e.keycode) {                     case 9:                         if (editing == true) {                             e.preventdefault();                             var direction = "right";                             if (e.shiftkey) {                                 direction = "left";                             }                             root.gridsave();                             root.movemark(direction);                             var checker = true;                             var c = 0;                             while (checker) {                                 if (!clicktarget) {                                     if (newline == true) {                                         root.marknewlinefirstcell();                                         root.scrollvert();                                     } else {                                         root.movemark("right");                                     }                                 }                                 if (!clicktarget.hasclass("editable")) {                                     root.movemark(direction);                                     if (c > root.captions.length) {                                         checker = false;                                     }                                     c++;                                 } else {                                     editmode = false;                                     root.edit(clicktarget);                                     root.setfocus(clicktarget);                                     checker = false;                                 }                             }                         } else {                             e.preventdefault();                             if (editmode == true) {                                 direction = "right";                                 if (e.shiftkey) {                                     direction = "left";                                 }                                 root.movemark(direction);                                 root.scrollvert();                             }                         }                         break; } }); 


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

json - ORA-06502: PL/SQL: numeric or value error: character string buffer too small - Convert Clob to varchar2 -

ios - Swift Array Resetting Itself -