Login Register

IE7 Dialog Focus Bug for Hidden Input Fields

Hey there,

I discovered what I believe is a Dojo bug with the Dialog implementation. If the first element in your dialog is a hidden input field (input type='hidden'), method _getFocusItems in dijit._DialogMixin will set the first focusable item to this field, even though it is not focusable. This breaks the tab functionality as you attempt to tab through the fields of the dialog...the dialog does not open with the correct field selected, and pressing the tab button with the last field selected doesn't have any effect. You can also reverse tab outside the dialog into the background of the page. This doesn't occur in FF2, but it does in IE7 and I think it's because this method doesn't check for hidden input fields:

http://api.dojotoolkit.org/jsdoc/dijit/HEAD/dijit._isElementShown

Workaround is to add style="display:none;" to your hidden input fields if they're inside a dialog.

- Chris

Fixed for 1.2

This was fixed for 1.2: http://bugs.dojotoolkit.org/ticket/6533.