Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #456 from nrkno/zindex-sf-fix
Browse files Browse the repository at this point in the history
core-dialog: fix sf z-index
  • Loading branch information
htor authored Apr 27, 2020
2 parents 171c4b7 + 87c8a28 commit b5414b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-dialog/core-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class CoreDialog extends HTMLElement {
reFocus(this._focus)
} else {
let zIndex = window.getComputedStyle(this).getPropertyValue('z-index')
if (zIndex === 'auto' && this.style.zIndex === '') { // Place this dialog over uppermost dialog if not controlled in CSS or JS
if ((zIndex === 'auto' || zIndex === '0') && this.style.zIndex === '') { // Place this dialog over uppermost dialog if not controlled in CSS or JS
const below = queryAll(this.nodeName).filter((el) => el !== nextBack && !this.contains(el) && isVisible(el))
zIndex = Math.min(Math.max(1, ...below.map(getZIndex)), 2000000000) // Avoid overflowing z-index. See techjunkie.com/maximum-z-index-value
if (nextBack) nextBack.style.zIndex = zIndex + 1
Expand Down

0 comments on commit b5414b0

Please sign in to comment.