Search and Top Navigation
#4309 closed bug (fixed)
Opened March 09, 2009 07:37PM UTC
Closed April 02, 2009 02:01AM UTC
Last modified September 01, 2012 11:05PM UTC
Opening multiple modal dialogs causes access problems to inputs
Reported by: | boconnor | Owned by: | scottgonzalez |
---|---|---|---|
Priority: | blocker | Milestone: | 1.7.2 |
Component: | ui.dialog | Version: | 1.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
A modal dialog (Dialog A) is opened that has an <input> field.
Another modal dialog (Dialog B) is opened.
Modal Dialog B is closed.
It is now impossible to focus on the <input> field in Modal Dialog A.
Bug exists on all browsers.
Attachments (3)
Change History (10)
Changed March 20, 2009 03:59PM UTC by comment:1
Changed March 20, 2009 04:31PM UTC by comment:2
Removing the if expression from this code block also makes it so it works:
destroy: function($el) { this.instances.splice($.inArray(this.instances, $el), 1); if (this.instances.length === 0) { $([document, window]).unbind('.dialog-overlay'); } $el.remove(); }
I think this would break all the overriding event binds from the original dialog box though. It looks like it should unbind all the .dialog-overlay events for the first dialog or previous dialog box if more than 2.
Changed March 20, 2009 05:28PM UTC by comment:3
The patch file I put in there is the current patch file we are going to use to get around this until a better solution becomes available. Hopefully it might help in coming up with a more permanent solution in the core.
Changed March 27, 2009 11:27PM UTC by comment:4
milestone: | TBD → 1.8 |
---|
Changed April 01, 2009 04:16PM UTC by comment:5
owner: | → scott.gonzalez |
---|---|
status: | new → accepted |
Changed April 02, 2009 02:01AM UTC by comment:6
resolution: | → fixed |
---|---|
status: | accepted → closed |
Fixed in r2431.
Changed June 12, 2009 12:39PM UTC by comment:7
milestone: | 1.8 → 1.7.2 |
---|
Changed March 29, 2010 01:52PM UTC by comment:8
using 1.8rc3, the problem still happens, also for the test-case
Changed April 15, 2010 03:02PM UTC by comment:9
I ran into this problem despite the fixes because I had another element in the page using the ui-dialog class (an older piece of the page was using jqModal, and we updated it to look like ui-dialog by just putting the class on the DIV). As a result, because this element did not have a z-index, when the line of code that checks the z-index was run, the value of z-index was "auto". This causes maxZ to be evaluated as NaN, and causes the problem described above. I was able to fix the problem by ensuring this other element had a numerical z-index.
Changed September 01, 2012 11:05PM UTC by comment:10
_comment0: | I am using slick grid within a dialog. \ I ran into the following problem only in firefox: \ I add a contextmenu handler to a cell in a table in a dialog. \ The contextmenu event is only called when double right clicking. \ Here is a simplified example: \ http://jsbin.com/idayod/2/edit \ \ When you only right click once the event is stopped in the mousedown event somewhere around here: \ \ \ {{{ \ $( document ).bind( $.ui.dialog.overlay.events, function( event ) { \ // stop events if the z-index of the target is < the z-index of the overlay \ // we cannot return true when we don't want to cancel the event (#3523) \ if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { \ return false; \ } \ }); \ }}} \ Line ~690 in jquery.ui.dialog.js \ \ → 1346541694112396 |
---|---|
_comment1: | I am using slick grid within a dialog. \ I ran into the following problem only in firefox: \ I add a contextmenu handler to a cell in a table in a dialog. \ The contextmenu event is only called when double right clicking. \ Here is a simplified example: \ http://jsbin.com/idayod/2/edit \ \ When you only right click once the event is stopped in the mousedown event somewhere around here: \ \ \ {{{ \ $( document ).bind( $.ui.dialog.overlay.events, function( event ) { \ // stop events if the z-index of the target is < the z-index of the overlay \ // we cannot return true when we don't want to cancel the event (#3523) \ if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { \ return false; \ } \ }); \ }}} \ Line ~690 in jquery.ui.dialog.js \ \ EDIT: \ A possible fix would be to check if the dialog contains the element I think. \ Something like this: \ \ {{{ \ \ if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ && !(dialog.element.has(event.target).length ) ) { \ return false; \ } \ }}} \ \ → 1347959697902785 |
EDIT: moved to new ticket
This has something to do with the events being added to modals. If you remove the event list from line ( link to code ) it works. Of course, this also breaks other functionality. I haven't determined if it's related to when they are binded or when they are unbinded. If there are any events in there, this problem persists. I tried removing each individual one. Didn't help.