mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
Merge pull request #1998 from umap-project/1997-help-zindex
fix: handle the 'auto' value special case for z-index
This commit is contained in:
commit
c5e7e91386
1 changed files with 8 additions and 4 deletions
|
@ -97,9 +97,11 @@ export default class Dialog extends WithTemplate {
|
||||||
|
|
||||||
currentZIndex() {
|
currentZIndex() {
|
||||||
return Math.max(
|
return Math.max(
|
||||||
...Array.from(document.querySelectorAll('dialog')).map(
|
...Array.from(document.querySelectorAll('dialog')).map((el) => {
|
||||||
(el) => window.getComputedStyle(el).getPropertyValue('z-index') || 0
|
const zIndex = window.getComputedStyle(el).getPropertyValue('z-index')
|
||||||
)
|
if (zIndex === 'auto') return 0
|
||||||
|
return zIndex || 0
|
||||||
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +129,9 @@ export default class Dialog extends WithTemplate {
|
||||||
this.hasFormData = this.elements.fieldset.elements.length > 0
|
this.hasFormData = this.elements.fieldset.elements.length > 0
|
||||||
|
|
||||||
const currentZIndex = this.currentZIndex()
|
const currentZIndex = this.currentZIndex()
|
||||||
if (currentZIndex) this.dialog.style.zIndex = currentZIndex + 1
|
if (currentZIndex) {
|
||||||
|
this.dialog.style.zIndex = currentZIndex + 1
|
||||||
|
}
|
||||||
|
|
||||||
this.toggle(true)
|
this.toggle(true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue