Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9048 closed bug (fixed)

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.

Change History (4)

comment:1 Changed 7 years ago by mziech

I already implemented a unit test you could use to verify this bug: http://jsfiddle.net/gZETu/7/

comment:2 Changed 7 years ago by tj.vantoll

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/.

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

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

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

Milestone: none1.10.1
Note: See TracTickets for help on using tickets.