From 593a6a72d2750135dbe6348b53f48b18db6032b5 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Wed, 11 Sep 2019 17:02:22 +0200 Subject: [PATCH] fix(datepicker): increase datepicker z-index in modals --- frontend/src/utils/form/datepicker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/utils/form/datepicker.js b/frontend/src/utils/form/datepicker.js index 11d7394bc..acc057502 100644 --- a/frontend/src/utils/form/datepicker.js +++ b/frontend/src/utils/form/datepicker.js @@ -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;