Bug Tracker

Ticket #6951 (closed bug: worksforme)

Opened 4 years ago

Last modified 3 years ago

.keydown() not working in IE7 for Enter keybutton

Reported by: jtanmay Owned by:
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: .keydown() Cc:
Blocking: Blocked by:

Description

I tried even on the demo on live jquery site, .keydown() does not handle the Enter button.

Change History

comment:1 Changed 4 years ago by addyosmani

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to worksforme

The keyCode for the return/enter button is '13'. The demo on the jQuery API Documentation site that lets you test .keydown() is actually doing the following when you hit the return key:

if (event.keyCode == '13') {

event.preventDefault();

}

If you actually code up your own routine using .keydown() with a simple alert(event.keyCode) and test this in any version of FireFox, Chrome or IE, you'll find that they all correctly capture the enter key being pressed.

I've verified this across IE 7, 8 and 9 just to ensure it's working fine.

Closing ticket.

comment:2 Changed 4 years ago by sderickson@…

I had the same problem, but I believe it has to do with IETester. I was running test in IETester in an IE8 tab and, as the OP said, the Enter key was not being registered for keydown events. I then went to another computer running IE8 without the aid of IETester and the keydown event fired as it should.

Note: See TracTickets for help on using tickets.