Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#6647 closed bug (duplicate)

Focus loop override in modal dialogs not working in non-Gecko browsers

Reported by: CloudStrife Owned by:
Priority: undecided Milestone: 1.5
Component: ui.dialog Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:


The dialog module has this code to override the browser focus loop:

prevent tabbing out of modal dialogs

if (options.modal) {

uiDialog.bind('keypress.ui-dialog', function(event) {

if (event.keyCode !== $.ui.keyCode.TAB) {



var tabbables = $(':tabbable', this),

first = tabbables.filter(':first'), last = tabbables.filter(':last');

if ( === last[0] && !event.shiftKey) {

first.focus(1); return false;

} else if ( === first[0] && event.shiftKey) {

last.focus(1); return false;


However, I have found that Safari 5 and IE 8 do not run this handler when TAB is pressed. It is, however, run when normal printable characters are entered in input fields, etc.

Perhaps the devs can investigate a workaround using keydown for the affected browsers...?

Change History (4)

comment:1 Changed 12 years ago by Scott González

Resolution: duplicate
Status: newclosed

comment:2 Changed 12 years ago by Scott González

Duplicate of #3768.

comment:3 Changed 12 years ago by CloudStrife

Hi Scott, are you sure this is a duplicate? #3768 specifically mentions non-modal dialogs, but I have found this issue applies to modal dialogs on affected browsers.

P.S. After skimming the other tickets marked duplicate, I see that the same issue has indeed been filed.

Last edited 12 years ago by CloudStrife (previous) (diff)

comment:4 Changed 11 years ago by Scott González

Component: unfiledui.dialog
Note: See TracTickets for help on using tickets.