Skip to content

Commit

Permalink
fix(ui5-input): correct acc info implementation (#846)
Browse files Browse the repository at this point in the history
The accInfo method used to return undefined for соме aria attributes. 
Now the method works as expected.
  • Loading branch information
ivoplashkov authored and ilhan007 committed Oct 14, 2019
1 parent e1de47c commit 7d547ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/main/src/Input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<span id="{{_id}}-suggestionsText" class="ui5-hidden-text">{{suggestionsText}}</span>
{{/if}}

{{#if accInfo.input.ariaDescribedBy}}
<span id="{{accInfo.input.ariaDescribedBy}}" class="ui5-hidden-text">{{accInfo.input.ariaDescription}}</span>
{{#if accInfo.input.ariaDescription}}
<span id="{{_id}}-descr" class="ui5-hidden-text">{{accInfo.input.ariaDescription}}</span>
{{/if}}

{{#if hasValueState}}
<span id="{{_id}}-descr" class="ui5-hidden-text">{{valueStateText}}</span>
<span id="{{_id}}-valueStateDesc" class="ui5-hidden-text">{{valueStateText}}</span>
{{/if}}
</div>

Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ class Input extends UI5Element {
}

get valueStateTextId() {
return this.hasValueState ? `${this._id}-descr` : "";
return this.hasValueState ? `${this._id}-valueStateDesc` : "";
}

get accInfo() {
Expand All @@ -596,10 +596,10 @@ class Input extends UI5Element {
"wrapper": {
},
"input": {
"ariaDescribedBy": this._inputAccInfo ? `${this.suggestionsTextId} ${this.valueStateTextId} ${this._inputAccInfo.ariaDescribedBy}`.trim() : `${this.suggestionsTextId} ${this.valueStateTextId}`.trim(),
"ariaDescribedBy": this._inputAccInfo.ariaDescribedBy ? `${this.suggestionsTextId} ${this.valueStateTextId} ${this._inputAccInfo.ariaDescribedBy}`.trim() : `${this.suggestionsTextId} ${this.valueStateTextId}`.trim(),
"ariaInvalid": this.valueState === ValueState.Error ? "true" : undefined,
"ariaHasPopup": this._inputAccInfo ? this._inputAccInfo.ariaHasPopup : ariaHasPopupDefault,
"ariaAutoComplete": this._inputAccInfo ? this._inputAccInfo.ariaAutoComplete : ariaAutoCompleteDefault,
"ariaHasPopup": this._inputAccInfo.ariaHasPopup ? this._inputAccInfo.ariaHasPopup : ariaHasPopupDefault,
"ariaAutoComplete": this._inputAccInfo.ariaAutoComplete ? this._inputAccInfo.ariaAutoComplete : ariaAutoCompleteDefault,
"role": this._inputAccInfo && this._inputAccInfo.role,
"ariaOwns": this._inputAccInfo && this._inputAccInfo.ariaOwns,
"ariaExpanded": this._inputAccInfo && this._inputAccInfo.ariaExpanded,
Expand Down

0 comments on commit 7d547ec

Please sign in to comment.