@@ -55,7 +55,7 @@ interface IButton extends HTMLElement, ITabbable {
55
55
let isGlobalHandlerAttached = false ;
56
56
let activeButton : Button | null = null ;
57
57
58
- type ButtonAccessibilityAttributes = Pick < AccessibilityAttributes , "expanded" | "hasPopup" | "controls" > ;
58
+ type ButtonAccessibilityAttributes = Pick < AccessibilityAttributes , "expanded" | "hasPopup" | "controls" | "ariaKeyShortcuts" | "ariaLabel" > ;
59
59
60
60
type ButtonClickEventDetail = {
61
61
originalEvent : MouseEvent ,
@@ -235,6 +235,11 @@ class Button extends UI5Element implements IButton {
235
235
* - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.
236
236
* Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.
237
237
*
238
+ * - **ariaLabel**: Defines the accessible ARIA name of the component.
239
+ * Accepts any string value.
240
+ *
241
+ * - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or give focus to the button.
242
+ *
238
243
* - **controls**: Identifies the element (or elements) whose contents or presence are controlled by the button element.
239
244
* Accepts a lowercase string value.
240
245
*
@@ -573,10 +578,6 @@ class Button extends UI5Element implements IButton {
573
578
this . active = active ;
574
579
}
575
580
576
- get _hasPopup ( ) {
577
- return this . accessibilityAttributes . hasPopup ;
578
- }
579
-
580
581
get hasButtonType ( ) {
581
582
return this . design !== ButtonDesign . Default && this . design !== ButtonDesign . Transparent ;
582
583
}
@@ -638,6 +639,16 @@ class Button extends UI5Element implements IButton {
638
639
return this . accessibleDescription === "" ? undefined : this . accessibleDescription ;
639
640
}
640
641
642
+ get _computedAccessibilityAttributes ( ) : ButtonAccessibilityAttributes {
643
+ return {
644
+ expanded : this . accessibilityAttributes . expanded ,
645
+ hasPopup : this . accessibilityAttributes . hasPopup ,
646
+ controls : this . accessibilityAttributes . controls ,
647
+ ariaKeyShortcuts : this . accessibilityAttributes . ariaKeyShortcuts ,
648
+ ariaLabel : this . accessibilityAttributes . ariaLabel || this . ariaLabelText ,
649
+ } ;
650
+ }
651
+
641
652
get effectiveBadgeDescriptionText ( ) {
642
653
if ( ! this . shouldRenderBadge ) {
643
654
return "" ;
0 commit comments