#5765 closed bug (worksforme)
datepicker doesn't inherit z-index from input
Reported by: | jackdied2 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.datepicker | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
line 664 of jquery.ui.datepicker.js
inst.dpDiv.zIndex($(input).zIndex()+1);
$(input).zIndex() always returns 0, even when input.style.zIndex and $(input).css('z-index') return something else.
I only tested the minified version.
Change History (7)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
I'm affected by this problem, too. I think users must set z-index with css rules as needed, it's almost useless to set a higher z-index when most input have z-index: auto.
comment:3 Changed 13 years ago by
It does seem like this line defeats the purpose of being able to set your own in any of the previous ways .... like: via css class OR using beforeShow to compute and return a z-index.
inst.dpDiv.zIndex($(input).zIndex()+1);
So I agree with making this change!
comment:4 Changed 12 years ago by
Had the same issue, opened jquery.ui.core.js and found this line: if (position == 'absolute' || position == 'relative' || position == 'fixed')
. My element position was "static" (by default), so I explicitly changed it to "relative" and $.zIndex() started working properly.
comment:5 Changed 11 years ago by
I have the same problem. jsFiddle test: http://jsfiddle.net/mrmamen/gDNys/
z-index of input element: 2 expected z-index of datepicker: 3 actual z-index of datepicker: 1
comment:6 Changed 10 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
As steelaz mentions, z-index isn't applied unless the element is positioned. Set position: relative
to get the z-index to apply.
I can attest to this as well, the z-index of the datepicker is always being set to 1. Is there a workaround for this? I tried using the dialog version, but this is not sufficient since it only sets the z-index to 2, and I need it to be at least 5.