Opened 9 years ago

Closed 7 years ago

#5388 closed bug (fixed)

Dialog: Don't change z-index when already at the top

Reported by: Jörn Zaefferer Owned by:
Priority: major Milestone: 1.10.0
Component: ui.dialog Version: 1.8
Keywords: Cc:
Blocked by: Blocking:

Description

To reproduce the issue, open tests/visual/compound/datepicker_dialog.html

Then click on the input (datepicker opens) and click on it again (dialog moves in front of datepicker), it shouldn't.

Change History (5)

comment:1 in reply to:  description Changed 9 years ago by watanabe

it seems "modal" dialog does not move in front of datepicker.

jQuery UI 1.8.1 Uncompressed Version.
jquery.ui.dialog.js
line 80(dialog _create)

.mousedown(function(event) {
	self.moveToTop(false, event);
}),

Test code:(for tests/visual/compound/datepicker_dialog.html)

$('#datepicker').mousedown(function () { return false; });

seems to prevent dialog moving in front of datepicker. (press tab key to focus #datepicker.)

I don't know how to find the dialog is already at the top.

Test code:(jquery.ui.dialog.js, line 254, dialog moveToTop)

if (self.uiDialog.css('z-index') != $.ui.dialog.maxZ) { //<-append
	if (self.overlay) {
		$.ui.dialog.maxZ += 1;
		self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);
	}

	//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
	//  http://ui.jquery.com/bugs/ticket/3193
	saveScroll = { scrollTop: self.element.attr('scrollTop'), scrollLeft: self.element.attr('scrollLeft') };
	$.ui.dialog.maxZ += 1;
	self.uiDialog.css('z-index', $.ui.dialog.maxZ);
	self.element.attr(saveScroll);
} //<-append

may work.

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

Milestone: 1.9.01.10.0

comment:3 Changed 7 years ago by petersendidit

#7884 is a duplicate of this ticket.

comment:4 Changed 7 years ago by petersendidit

Status: newopen

comment:5 Changed 7 years ago by Nate Eagle

Resolution: fixed
Status: openclosed

Dialog: Awesome new stacking and overlay implementation. Fixes the following tickets:

Fixes #3534 - Dialog: Modal dialog disables all input elements on page. Fixes #4671 - Dialog: Modal Dialog disables vertical scroll bar in Chrome & Safari. Fixes #4995 - Dialog: Modal Dialog's overlay dissapears in IE when content is tall. Fixes #5388 - Dialog: Don't change z-index when already at the top. Fixes #5466 - Dialog: "modal" Dialog Incorrectly Cancels Input Events. Fixes #5762 - Dialog: Get rid of z-index workaround, document it instead. Fixes #6267 - Dialog: checkboxes that inherit a z-index < jqueryui.dialog z-index don't work. Fixes #7051 - Dialog: modal prevents tab key from moving focus off slider handle. Fixes #7107 - Dialog: Modal dialog event loss with high zindex child elements (FF 3.6). Fixes #7120 - Dialog: Modal operation interrupts drag drop marker functionality on gmaps. Fixes #8172 - Dialog: Change event cancelled when opening modal dialog from another modal dialog. Fixes #8583 - Dialog: Mouse event wrongly stopped. Fixes #8722 - Dialog: Remove stack option. Fixes #8729 - Dialog: Remove zIndex option.

Changeset: 3829a37ca122e923c3a08b964c4b1a946a2a1456

Note: See TracTickets for help on using tickets.