#9077 closed bug (fixed)
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.
Change History (4)
comment:1 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | Draggables with the stack option reset the z-index of the element when dragged → Draggable: stack option resets the z-index |
comment:3 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Draggable: Account for z-index set in CSS for the stack option. Fixed #9077 - Draggable: stack option resets the z-index
Changeset: c32bebd1bd28d158b017bb1dd7f95fb1d8a8d567
comment:4 Changed 10 years ago by
Milestone: | none → 1.10.1 |
---|
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.