Skip to content

Commit

Permalink
fix: Fix aria-disabled usage (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhan007 authored Aug 3, 2020
1 parent efe03bc commit bb624ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/ProgressIndicator.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
aria-valuenow="{{validatedValue}}"
aria-valuemax="100"
aria-valuetext="{{valueStateText}}"
?aria-disabled="{{disabled}}"
aria-disabled="{{_ariaDisabled}}"
>
<div class="ui5-progress-indicator-bar" style="{{styles.bar}}">
{{#unless showValueInRemainingBar}}
Expand Down
4 changes: 4 additions & 0 deletions packages/main/src/ProgressIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ class ProgressIndicator extends UI5Element {
return this.valueStateIconMappings()[this.valueState];
}

get _ariaDisabled() {
return this.disabled || undefined;
}

static async onDefine() {
await fetchI18nBundle("@ui5/webcomponents");
}
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/RatingIndicator.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
role="slider"
aria-roledescription="{{_ariaRoleDescription}}"
aria-valuemin="0"
aria-valuenow="{{this.value}}"
aria-valuemax="{{this.maxValue}}"
aria-valuenow="{{value}}"
aria-valuemax="{{maxValue}}"
aria-orientation="horizontal"
?aria-disabled="{{this.disabled}}"
?aria-readonly="{{this.readOnly}}"
aria-disabled="{{_ariaDisabled}}"
?aria-readonly="{{readOnly}}"
tabindex="{{tabIndex}}"
@focusin="{{_onfocusin}}"
@focusout="{{_onfocusout}}"
Expand Down
4 changes: 4 additions & 0 deletions packages/main/src/RatingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ class RatingIndicator extends UI5Element {
get _ariaRoleDescription() {
return this.i18nBundle.getText(RATING_INDICATOR_TEXT);
}

get _ariaDisabled() {
return this.disabled || undefined;
}
}

RatingIndicator.define();
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/TabInStrip.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
aria-setsize="{{this._setsize}}"
aria-controls="ui5-tc-contentItem-{{this._posinset}}"
aria-selected="{{this.effectiveSelected}}"
?aria-disabled="{{this.effectiveDisabled}}"
aria-disabled="{{this.effectiveDisabled}}"
?disabled="{{this.effectiveDisabled}}"
aria-labelledby="{{this.ariaLabelledBy}}"
data-ui5-stable="{{this.stableDomRef}}"
Expand Down

0 comments on commit bb624ae

Please sign in to comment.