File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,15 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
111
111
@property ( { type : String , attribute : 'select-mode' , reflect : true } )
112
112
public selectMode ?: 'highlight' | 'persisting' ;
113
113
114
+ /**
115
+ * Sets the aria-label for the caret button.
116
+ * @remark Only used when the menu item has children.
117
+ * @attr
118
+ * @default 'Reveal the underlying items'
119
+ */
120
+ @property ( { type : String , attribute : 'caret-label' } )
121
+ public caretLabel = 'Reveal the underlying items' ;
122
+
114
123
@state ( )
115
124
private iconSlotHasContent = false ;
116
125
@@ -206,8 +215,13 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
206
215
return html `
207
216
<div id= "menu-item" aria-label = "menuitem" role= "menuitem">
208
217
${ this . hasChildren
209
- ? html `<butto n id= "caret-button" @click = ${ this . _onCaretClicked } >
210
- <uui- symbol- expand ?open= ${ this . showChildren } > </ uui- symbol- expand >
218
+ ? html `<butto n
219
+ id= "caret-button"
220
+ aria-label = ${ this . caretLabel }
221
+ @click = ${ this . _onCaretClicked } >
222
+ <uui- symbol- expand
223
+ aria- hidden= "true"
224
+ ?open= ${ this . showChildren } > </ uui- symbol- expand >
211
225
</ butto n> `
212
226
: '' }
213
227
${ this . href ? this . _renderLabelAsAnchor ( ) : this . _renderLabelAsButton ( ) }
You can’t perform that action at this time.
0 commit comments