Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#6136 closed bug (duplicate)

UI Dialog focus-leaving-dialog-prevention routine prevents events on the last element

Reported by: DanielCeregatti Owned by:
Priority: minor Milestone:
Component: ui.dialog Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:

Description

When using a ui dialog with the modal option enabled, there is code present (http://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.dialog.js#L321) that prevents focus from leaving the dialog by focusing the first element after tabbing from the last element, regardless of the tabbing direction (normal forward tabbing and shift-tab for backwards tabbing). The problem is that the callback handler for the keypress event (which has problems in browsers other than Firefox. See bugs http://dev.jqueryui.com/ticket/5896 and http://dev.jqueryui.com/ticket/6101), which is checking for tab, returns false, thereby causing any other event handlers, such as blur, from firing. The solution, in my test case, at least, is to simply return true here http://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.dialog.js#L333 and here http://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.dialog.js#L336.

My test case: http://jsfiddle.net/NMNFp/3/

Since I've specified which lines have to change, and what has to change, please consider this a patch.

Attachments (1)

patch (398 bytes) - added by DanielCeregatti 9 years ago.
Patch that implements my suggested changes.

Download all attachments as: .zip

Change History (3)

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

Component: ui.coreui.dialog
Resolution: duplicate
Status: newclosed

Duplicate of #5763.

Changed 9 years ago by DanielCeregatti

Attachment: patch added

Patch that implements my suggested changes.

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

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.