Skip to main content

Search and Top Navigation

#9048 closed bug (fixed)

Opened February 01, 2013 05:14PM UTC

Closed February 03, 2013 12:32AM UTC

Last modified February 03, 2013 12:33AM UTC

Dialog: broken focusin event handler when beforeclose event of a modal opens another modal

Reported by: mziech Owned by:
Priority: minor Milestone: 1.10.1
Component: ui.dialog Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:
Description

When opening a modal dialog within the beforeclose event handler of another modal dialog, a stale focusin event handler remains after all dialogs are closed. An error will occur on the first focus event after the dialogs were closed.

The following example was tested in Chromium 23.0.1271.97 and Firefox 18.0.1 and will output an error message to the console:

http://jsfiddle.net/gZETu/6/

While debugging into this, I figured out that the focusin event is obviously registered within the namespace of the first dialog (dialog0). After closing the second dialog, it tries to deregister the focusin event within the wrong namespace, the one of the second dialog (dialog4). This leaves the stale event handler registered.

Attachments (0)
Change History (4)

Changed February 01, 2013 05:34PM UTC by mziech comment:1

I already implemented a unit test you could use to verify this bug:

http://jsfiddle.net/gZETu/7/

Changed February 02, 2013 02:17AM UTC by tj.vantoll comment:2

status: newopen
summary: Dialog leaves broken focusin event handler when opened from beforeclose-handler of another modal dialogDialog: broken focusin event handler when beforeclose event of a modal opens another modal

Confirmed against master and minified a bit http://jsfiddle.net/tj_vantoll/5gyZw/.

Changed February 03, 2013 12:32AM UTC by Scott González comment:3

resolution: → fixed
status: openclosed

Dialog: Don't use ._on() for modal event handlers. Fixes #9048 - Dialog: broken focusin event handler when beforeclose event of a modal opens another modal.

Changeset: 8724092e5070125e2610e8b0e6ee9ada126cf504

Changed February 03, 2013 12:33AM UTC by scottgonzalez comment:4

milestone: none1.10.1