views:

317

answers:

0

When creating a dialog using window.showModalDialog (where the options do not display any addressbar or toolbar) from javascript in IE - the behavior of pressing the ALT key is doing something undesirable.

When you hit the ALT key when focus is on the modal dialog - the ALT key press event is handled by my javascript code fine, but whether I allow the event to continue to bubble up or not - it seems like IE is always jumping the focus to a 'hidden' menu in the modal dialog. You can get to this menu from a modal dialog by hitting ALT, and then space.

Sequence of events:

  1. From a modal dialog, user hits the ALT key
  2. My event handling code catches this ALT key and does something
  3. User hits another key
  4. My event handling code (for any keyup) is not executed, seems like b/c the focus was on the alt+space menu, and the last key press jumped focus back to the modal dialog
  5. User hits another key
  6. My event handling code is executed as normal

Here are the features I'm supplying to showModalDialog:

var strFeatures = "unadorned:yes,resizable:no;scroll:yes;help:no;status:no;";

Is there anyway to prevent focus to the hidden menu after hitting the alt-key for modal dialogs? When creating a normal window using window.open - this behavior does NOT happen, and hitting ALT doesnt go to a hidden menu (assuming menubar is off, address bar is off, etc.)