Ticket #4975 (closed bug: wontfix)

Opened 5 years ago

Last modified 23 months ago

Dialog: Cannot modify zIndex option after init

Reported by: betobaz Owned by:
Priority: major Milestone: 1.10.0
Component: ui.dialog Version: 1.7.2
Keywords: zIndex Cc:
Blocking: Blocked by:

Description (last modified by scott.gonzalez) (diff)

.dialog('option', 'zIndex', val) doesn't do anything if the dialog is already open.

Change History

comment:1 Changed 5 years ago by joern.zaefferer

Please provide the description in english.

comment:2 Changed 5 years ago by scott.gonzalez

  • Description modified (diff)
  • Summary changed from Problema con dialog('option','zIndex',value), [Posible solucion] to Dialog: Cannot modify zIndex option after init

comment:3 Changed 5 years ago by rdworth

  • Milestone changed from TBD to 1.8

comment:4 Changed 5 years ago by betobaz

Sorry, i'm from Mexico and i don't speaking english very well. Using UI Dialog I find that zIndex allocation does not work, in jquery-ui-1.7.2.custom, the _setData function don't have the case for zIndex. The solution that i give is the follow:

case "zIndex":

this.uiDialog.css("z-index",value); (this.overlay&&this.overlay.$el.css("z-index",--value)); break;

I hope that my contribution is helpfull

comment:5 Changed 4 years ago by spudly

I would also like to see this fixed.

The problem seems to be that _setOption is defined in the dialog widget but "zIndex" is not in the switch statement. As a result, you can neither get nor set the zIndex of the dialog. I would say this is a feature, but the documentation says this should work.

In my case, I need to modify the zindex each time the dialog is opened to ensure it opens on top.

comment:6 follow-up: ↓ 7 Changed 3 years ago by adovenmuehle

This issue seems to be fixed in 1.8.9, see  http://jsfiddle.net/AVxGY/

comment:7 in reply to: ↑ 6 Changed 3 years ago by rdworth

Replying to adovenmuehle:

This issue seems to be fixed in 1.8.9, see  http://jsfiddle.net/AVxGY/

Nope. Your test is only checking that the option has changed, not that the option change has actually had an effect on the ui-dialog element. See  http://jsfiddle.net/rdworth/AVxGY/1/

comment:8 Changed 23 months ago by scott.gonzalez

  • Milestone changed from 1.9.0 to 1.10.0

comment:9 Changed 23 months ago by petersendidit

  • Status changed from new to open

comment:10 Changed 23 months ago by fontzter

  • Owner set to fontzter
  • Status changed from open to assigned

comment:11 Changed 23 months ago by fontzter

  • Owner fontzter deleted
  • Status changed from assigned to open

A more extensive example is here:  http://jsfiddle.net/fontzter/qjeHT/2/

This will likely be resolved in the reworking of zIndex and modality.

A possible workaround is to add the following case to the switch within the _setOption:

case "zIndex":
	this.uiDialog.css( "z-index", value );
	this.options.zIndex = value;

	// maxZ needs to be reset if the dialog is opened
	if ( this._isOpen ) {
		this.moveToTop();
	}
	break;

comment:12 Changed 23 months ago by bchiasson

  • Owner set to bchiasson
  • Status changed from open to assigned

comment:13 Changed 23 months ago by bchiasson

  • Owner bchiasson deleted
  • Status changed from assigned to open

comment:14 Changed 23 months ago by scott.gonzalez

  • Status changed from open to closed
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.