uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.66k stars 6.07k forks source link

z-index (set by zIndexOffset) gets reset to -Infinity when the direct parents have no explicit z-index #2109

Open JorrisBesselink opened 7 years ago

JorrisBesselink commented 7 years ago

Expected behaviour

z-index should have the value of the zIndexOffset options property.

Actual behaviour

z-index gets value -Infinity

Datepicker version used

ex. 1.6.1.

Using Math.max on an empy array causes the issue, check for empty array and skip the manipulation of zIndexOffset when empty, to avoid resetting to -Infinity.

acrobat commented 7 years ago

Thanks for this bugreport. I've indeed located the code which caused this issue. What should the zindex be when we can't determine it? 0 or ...?

JorrisBesselink commented 7 years ago

Leave the settings value unchanged if it cannot be determined.