Skip to main content

Search and Top Navigation

#9077 closed bug (fixed)

Opened February 11, 2013 08:45AM UTC

Closed February 13, 2013 02:29AM UTC

Last modified February 13, 2013 02:31AM UTC

Draggable: stack option resets the z-index

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

***test case here***: http://jsfiddle.net/gwDXP/2/

This bug is observed when one's using draggables with the stack option activated, like in:

$( ".plugin" ).draggable({cursor: "move", opacity: 0.9, stack: ".plugin", scroll: true});

''Problem:''

When one of the divs gets dragged, its z-index is reset to 1 (and incremented each time it is sent to the top, because of the stack option).

''Desidered behaviour:''

The div z-index should start from the original z-index value for the .plugin divs (200, in the linked test case) and be incremented from that value.

''Additional details:''

Jquery-ui 1.7 had a min parameter for the stack option.

In newer versions of jquery-ui (1.9.2 to 1.10 is affected, for instance), you can only specify a selector, and, from which I can understand, the stacking should start from the pre-existent z-index of the element. Instead, it seems arbitrarily re-starting at 1.

Attachments (0)
Change History (4)

Changed February 12, 2013 03:37AM UTC by tj.vantoll comment:1

status: newopen
summary: Draggables with the stack option reset the z-index of the element when draggedDraggable: stack option resets the z-index

See #4365 for discussion of the hash for the

stack
option being removed.

It looks like the min is *supposed* to be the

z-index
of the first element matching the selector - https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.draggable.js#L920. That indeed does not appear to be working.

Changed February 12, 2013 04:32AM UTC by tj.vantoll comment:2

Changed February 13, 2013 02:29AM UTC by TJ VanToll comment:3

resolution: → fixed
status: openclosed

Draggable: Account for z-index set in CSS for the stack option. Fixed #9077 - Draggable: stack option resets the z-index

Changeset: c32bebd1bd28d158b017bb1dd7f95fb1d8a8d567

Changed February 13, 2013 02:31AM UTC by tj.vantoll comment:4

milestone: none1.10.1