Skip to content

Commit 6e1306c

Browse files
dobrinyonkovkineticjs
authored andcommitted
fix(ui5-checkbox): add aria-hidden attribute to icon (#3511)
The role presentation on the icon SVG is ignored in some cases: *The element is focusable, e.g. it is natively focusable like an HTML link or input, or it has a tabindex attribute. *The element has any of the twenty-one global ARIA states and properties, e.g., aria-label. With this change we introduce ariaHidden property on ui5-icon to be able to completly hide it from accessibility tree mapping. Also, change the default value of effectiveAccessibleName to undefined as a value of "" will still set the aria-label attribute and the presentation role will be ignroed. Fixes #3433
1 parent d229706 commit 6e1306c

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

packages/main/src/Breadcrumbs.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<li class="ui5-breadcrumbs-overflow-opener"
88
?hidden="{{_isOverflowEmpty}}">
99
<ui5-link @click="{{_openRespPopover}}"
10+
role="button"
1011
aria-label="{{_overflowAccessibleNameText}}"
1112
aria-haspopup="{{_ariaHasPopup}}">
1213
<ui5-icon name="slim-arrow-down"

packages/main/src/Breadcrumbs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const metadata = {
124124
* @class
125125
*
126126
* <h3 class="comment-api-title">Overview</h3>
127-
*
127+
* Enables users to navigate between items by providing a list of links to previous steps in the user's navigation path. The last three steps can be accessed as links directly, while the remaining links prior to them are available in a drop-down menu.
128128
*
129129
* @constructor
130130
* @author SAP SE

packages/main/src/Link.hbs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<a
22
class="ui5-link-root"
3-
role="link"
3+
role="{{effectiveAccRole}}"
44
href="{{parsedRef}}"
55
target="{{target}}"
66
rel="{{_rel}}"
77
tabindex="{{tabIndex}}"
88
?disabled="{{disabled}}"
99
aria-label="{{ariaLabelText}}"
10+
aria-haspopup="{{ariaHaspopup}}"
1011
@focusin={{_onfocusin}}
1112
@focusout={{_onfocusout}}
1213
@click={{_onclick}}

packages/main/src/Link.js

+27
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,29 @@ const metadata = {
127127
defaultValue: "",
128128
},
129129

130+
/**
131+
* Defines the aria-haspopup value of the component.
132+
*
133+
* @type String
134+
* @defaultvalue undefined
135+
* @since 1.0.0-rc.15
136+
* @private
137+
*/
138+
ariaHaspopup: {
139+
type: String,
140+
defaultValue: undefined,
141+
},
142+
143+
/**
144+
* Defines the accessibility role of the component.
145+
* @defaultvalue ""
146+
* @private
147+
* @since 1.0.0-rc.15
148+
*/
149+
role: {
150+
type: String,
151+
},
152+
130153
_rel: {
131154
type: String,
132155
noAttribute: true,
@@ -283,6 +306,10 @@ class Link extends UI5Element {
283306
return (this.href && this.href.length > 0) ? this.href : undefined;
284307
}
285308

309+
get effectiveAccRole() {
310+
return this.role || "link";
311+
}
312+
286313
static async onDefine() {
287314
await fetchI18nBundle("@ui5/webcomponents");
288315
}

0 commit comments

Comments
 (0)