Firefox 1.5 Keypress Event Changes

Someone submitted a post to the P2P forum saying that one of my book examples is no longer working in Firefox 1.5. After some investigating, I made an interesting discovery. It seems that in Firefox 1.5, the keypress event behaves differently than in previous version.

As I said in Professional JavaScript, the keypress event fires only for character keys (those keys that produce output). Prior to Firefox (and in other browsers) these did not include keys like Backspace and Delete. Firefox 1.5 now fires the event for Backspace, Delete, Ins, and Pause/Break. I haven’t been able to find a bug relating to this change, but it sure is annoying.

Master JavaScript Promises

Free E-book - Understanding JavaScript Promises

What You'll Learn

  • Promise fundamentals and concepts
  • Real-world promise implementations
  • Best practices and patterns
  • Error handling techniques

Demystify JavaScript promises with practical examples and expert insights.

Download Your Free Copy

The community edition arrives in your inbox within minutes.