@@ -163,10 +163,11 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
163163 this . showChildren = ! this . showChildren ;
164164 } ;
165165
166- private _onLabelClicked = ( ) => {
166+ #onLabelClicked( ) {
167+ if ( this . selectOnly ) return ;
167168 const event = new UUIMenuItemEvent ( UUIMenuItemEvent . CLICK_LABEL ) ;
168169 this . dispatchEvent ( event ) ;
169- } ;
170+ }
170171
171172 private _renderLabelInside ( ) {
172173 return html ` <slot
@@ -195,7 +196,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
195196 this . target === '_blank' ? 'noopener noreferrer' : undefined ,
196197 ) ,
197198 ) }
198- @click = ${ this . _onLabelClicked }
199+ @click = ${ this . #onLabelClicked }
199200 ?dis abled= ${ this . disabled }
200201 aria- label= "${ this . label } " >
201202 ${ this . _renderLabelInside ( ) }
@@ -206,7 +207,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
206207 return html ` <butto n
207208 id= "label-button"
208209 ${ ref ( this . _labelButtonChanged ) }
209- @click = ${ this . _onLabelClicked }
210+ @click = ${ this . #onLabelClicked }
210211 ?dis abled= ${ this . disabled }
211212 aria- label= "${ this . label } " >
212213 ${ this . _renderLabelInside ( ) }
@@ -226,7 +227,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
226227 ?open= ${ this . showChildren } > </ uui- symbol- expand >
227228 </ butto n> `
228229 : '' }
229- ${ this . href && ! this . selectOnly
230+ ${ this . href && this . selectOnly !== true && this . selectable !== true
230231 ? this . _renderLabelAsAnchor ( )
231232 : this . _renderLabelAsButton ( ) }
232233
0 commit comments