Skip to content

Commit e33948c

Browse files
committed
Allow setting the aria-label
1 parent ce9c6c9 commit e33948c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

packages/breadcrumb/src/vaadin-breadcrumb.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
2727
*
2828
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
2929
*/
30-
declare class Breadcrumb extends ElementMixin(ThemableMixin(HTMLElement)) {}
30+
declare class Breadcrumb extends ElementMixin(ThemableMixin(HTMLElement)) {
31+
/**
32+
* The aria-label attribute for the breadcrumb navigation
33+
*/
34+
ariaLabel: string;
35+
}
3136

3237
declare global {
3338
interface HTMLElementTagNameMap {

packages/breadcrumb/src/vaadin-breadcrumb.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ class Breadcrumb extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMi
4949

5050
static get properties() {
5151
return {
52+
/**
53+
* The aria-label attribute for the breadcrumb navigation
54+
*/
55+
ariaLabel: {
56+
type: String,
57+
value: 'Breadcrumb',
58+
reflectToAttribute: true,
59+
sync: true,
60+
},
61+
5262
/**
5363
* The list of breadcrumb items
5464
* @type {!Array<!BreadcrumbItem>}
@@ -81,8 +91,6 @@ class Breadcrumb extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMi
8191
if (!this.hasAttribute('role')) {
8292
this.setAttribute('role', 'navigation');
8393
}
84-
85-
this.setAttribute('aria-label', 'Breadcrumb');
8694
}
8795

8896
/** @private */

0 commit comments

Comments
 (0)