Skip to main content

Search and Top Navigation

#6136 closed bug (duplicate)

Opened October 01, 2010 06:57PM UTC

Closed October 01, 2010 07:11PM UTC

Last modified October 11, 2012 09:15PM UTC

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 (0.4 KB) - added by DanielCeregatti October 01, 2010 07:14PM UTC.

    Patch that implements my suggested changes.

Change History (2)

Changed October 01, 2010 07:11PM UTC by scottgonzalez comment:1

component: ui.coreui.dialog
resolution: → duplicate
status: newclosed

Duplicate of #5763.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

milestone: TBD

Milestone TBD deleted