fix(datepicker): increase datepicker z-index in modals

This commit is contained in:
Sarah Vaupel 2019-09-11 17:02:22 +02:00
parent 33338cdfe9
commit 593a6a72d2

View File

@ -139,6 +139,11 @@ export class Datepicker {
// initialize tail.datetime (datepicker) instance
this.datepickerInstance = datetime(this._element, { ...datepickerGlobalConfig, ...datepickerConfig });
// if the input element is in any open modal, increase the z-index of the datepicker
if (this._element.closest('.modal--open')) {
this.datepickerInstance.dt.style.zIndex = 9999;
}
// register this datepicker instance with the formID of the given element in the datepicker collection
const formID = this._element.form.id;
const elemID = this._element.id;