diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 7babfcd92..816c08bd4 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -16,6 +16,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis - Fixed a bug where auto-size wasn't being applied to `` and `` - Fixed a bug in `` that caused auto-size to kick in before flip - Fixed a bug in `` that prevented the `arrow-padding` attribute from working as expected +- Fixed a bug in `` that prevented the popup from appearing with the correct z-index [#854](https://github.com/shoelace-style/shoelace/issues/854) - Improved accessibility of `` so keyboard nav works better and screen readers announce it properly - Improved accessibility of `` so screen readers no longer skip over it - Removed a user agent sniffing notice that appeared in Chrome [#855](https://github.com/shoelace-style/shoelace/issues/855) diff --git a/src/components/tooltip/tooltip.styles.ts b/src/components/tooltip/tooltip.styles.ts index d83cbc325..4ada09788 100644 --- a/src/components/tooltip/tooltip.styles.ts +++ b/src/components/tooltip/tooltip.styles.ts @@ -17,6 +17,10 @@ export default css` --arrow-color: var(--sl-tooltip-background-color); } + .tooltip::part(popup) { + z-index: var(--sl-z-index-tooltip); + } + .tooltip[placement^='top']::part(popup) { transform-origin: bottom; } @@ -44,6 +48,5 @@ export default css` color: var(--sl-tooltip-color); padding: var(--sl-tooltip-padding); pointer-events: none; - z-index: var(--sl-z-index-tooltip); } `;