Skip to content

Commit 68b2783

Browse files
committed
Revert "Remove z-index in the button"
This reverts commit c9785d2.
1 parent c9785d2 commit 68b2783

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

packages/uui-menu-item/lib/uui-menu-item.element.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
217217
render() {
218218
return html`
219219
<div id="menu-item" aria-label="menuitem" role="menuitem">
220-
<div id="label-button-background"></div>
221220
${this.hasChildren
222221
? html`<button
223222
id="caret-button"
@@ -232,6 +231,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
232231
? this._renderLabelAsAnchor()
233232
: this._renderLabelAsButton()}
234233
234+
<div id="label-button-background"></div>
235235
<slot id="actions-container" name="actions"></slot>
236236
${this.loading
237237
? html`<uui-loader-bar id="loader"></uui-loader-bar>`
@@ -265,10 +265,13 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
265265
}
266266
267267
/** Not active, not selected, not disabled: */
268-
/* Only when NOT active/selected/disabled/highlight … */
269268
:host(:not([active], [selected], [disabled], [select-mode='highlight']))
270-
#menu-item:has(#label-button:hover)
271-
#label-button-background {
269+
#menu-item
270+
#label-button:hover
271+
~ #label-button-background,
272+
:host(:not([active], [selected], [disabled]))
273+
#menu-item
274+
#caret-button:hover {
272275
background-color: var(
273276
--uui-menu-item-background-color-hover,
274277
var(--uui-color-surface-emphasis)
@@ -477,7 +480,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
477480
background-color: transparent;
478481
cursor: pointer;
479482
min-height: var(--uui-size-12);
480-
//z-index: 1;
483+
z-index: 1;
481484
}
482485
483486
#label-button {
@@ -495,7 +498,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
495498
text-decoration: none;
496499
color: currentColor;
497500
min-height: var(--uui-size-12);
498-
//z-index: 1;
501+
z-index: 1;
499502
font-weight: inherit;
500503
}
501504
@@ -554,18 +557,12 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
554557
555558
#badge {
556559
font-size: 12px;
557-
//Why is this duplicated?
558560
--uui-badge-position: relative;
559561
--uui-badge-position: auto;
560562
display: block;
561563
margin-left: 6px;
562564
}
563565
564-
#label-button ::slotted(uui-badge) {
565-
position: relative;
566-
z-index: 1;
567-
}
568-
569566
/** Focus styling */
570567
571568
:host([select-mode='highlight']) #label-button:focus-visible {

0 commit comments

Comments
 (0)