Keypress events stopped working outside the "input" elements in Meteor after upgrading to 0.5.2

I just found out that after upgrading to Meteor 0.5.2 (from 0.5) event processing for key events ("keypress", "keydown", keyup) stopped working for me. Other events like ('click' and "blur") work very well.

Even in sample applications, such code does nothing:

Template.someTemplate.events = {
  'keydown' : function(e) {
      console.log(e);
  }
};

Interestingly, this code really works (the function is triggered) for pressing keys in I type inside input type = "text" or text field. But in another place, nothing happens.

I am testing the latest Crome in Ubuntu 12.10.

Anyone else having a problem?

Thanks George

+3
source share
2

keydown html, . keydown.

, keydown , :

: https://groups.google.com/forum/?fromgroups=#!topic/meteor-talk/uHy--xIGH8o.

, body. , , , , jQuery :

Template.myTemplate.rendered = function() { 
        // Assuming you're using jQuery 
        $('body').on('keydown',function() { 
                console.log('key pressed'); 
        }); 
} 

, -, .

+9

$('body'). on ('keydown', function() {                 console.log( );         });

meteor.startup

0

All Articles