keithamus/jwerty

IE 8 issue when binding to enter key in textboxes

Open

#49 aperta il 15 mag 2014

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (117 fork)batch import
help wanted

Metriche repository

Star
 (1214 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

We use jwerty for handling enter key in textboxes. Works great in all browsers except for IE 8. When using jwerty to handle enter key in IE8 texbox, the default behavior is not prevented and causes an undesired form post to happen.

This is correctable in v.3 via the following jwerty.js code:

is: function (jwertyCode, event, i /? 0/) { jwertyCode = new JwertyCode(jwertyCode); // Default i to 0 i = i || 0; // We are only interesting in i of jwertyCode; jwertyCode = jwertyCode[i]; // jQuery stores the real event in originalEvent, which we use // because it does annoything stuff to metaKey event = event.originalEvent || event;

        //!!!!!!!!!Modification for IE 8 support!!!!!!!!!  Thanks be to ninja master Teddy for finding this!!!
        event.metaKey = event.metaKey || false;

Guida contributor