Skip to content

Commit cab01aa

Browse files
authored
Merge pull request #2144 from umbraco/v14/bugfix/caret-labels
Bugfix: Caret buttons in the menus have no aria-label
2 parents 93d8d00 + 97fc2d8 commit cab01aa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/packages/core/menu/components/menu-item-layout/menu-item-layout.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class UmbMenuItemLayoutElement extends UmbLitElement {
6161
return html`<uui-menu-item
6262
href="${ifDefined(this.href)}"
6363
label=${this.label}
64+
.caretLabel=${this.localize.term('visuallyHiddenTexts_expandChildItems') + ' ' + this.label}
6465
?active=${this._isActive}
6566
?has-children=${this.hasChildren}>
6667
<umb-icon slot="icon" name=${this.iconName}></umb-icon>

src/packages/core/tree/tree-item/tree-item-base/tree-item-element-base.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export abstract class UmbTreeItemElementBase<TreeItemModelType extends UmbTreeIt
109109
// Note: Currently we want to prevent opening when the item is in a selectable context, but this might change in the future.
110110
// If we like to be able to open items in selectable context, then we might want to make it as a menu item action, so you have to click ... and chose an action called 'Edit'
111111
override render() {
112+
const label = this.localize.string(this._item?.name ?? '');
112113
return html`
113114
<uui-menu-item
114115
@show-children=${this._onShowChildren}
@@ -120,7 +121,8 @@ export abstract class UmbTreeItemElementBase<TreeItemModelType extends UmbTreeIt
120121
?selected=${this._isSelected}
121122
.loading=${this._isLoading}
122123
.hasChildren=${this._hasChildren}
123-
label="${ifDefined(this.localize.string(this._item?.name || ''))}"
124+
.caretLabel=${this.localize.term('visuallyHiddenTexts_expandChildItems') + ' ' + label}
125+
label=${label}
124126
href="${ifDefined(this._isSelectableContext ? undefined : this._href)}">
125127
${this.renderIconContainer()} ${this.renderLabel()} ${this.#renderActions()} ${this.#renderChildItems()}
126128
<slot></slot>

0 commit comments

Comments
 (0)