Skip to content

Conversation

tsanislavgatev
Copy link
Contributor

Hi team, can you please review the PR.
Best Regards,
Tsani

}

get roleAttribute() {
if (this._accInfo && this._accInfo.roleAttribute) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine to return undefined, try
return this._accInfo && this._accInfo.roleAttribute;

Same for ariaOwns ariaExpanded

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, please ask Eli to test it too

></ui5-calendar>
</ui5-popover>

<span id="{{_id}}-date" class="ui5-hidden-text">{{dateAriaDescriber}}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describer => Description

"ariaDescribedBy": `${this._id}-date`,
"ariaHasPopup": "true",
"ariaAutoComplete": "none",
"roleAttribute": "combobox",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO just "role", they are all attributes

#XACT: ARIA announcement for the emphasized button
BUTTON_ARIA_TYPE_EMPHASIZED=Emphasized

#XACT: Aria information for the Date Picker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the translation team, they don't really know what this means, so simply put a text such as "Date" IMO

BUTTON_ARIA_TYPE_EMPHASIZED=Emphasized

#XACT: Aria information for the Date Picker
DATEPICKER_DATE_TYPE=Date
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DATE_TYPE sounds inaccurate, maybe DATEPICKER_DATE_ACC_TEXT or something

"ariaAutoComplete": "none",
"roleAttribute": "combobox",
"ariaOwns": `${this._id}-popover`,
"ariaExpanded": this.isOpen(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the value of this.isOpen() is changed? Does something invalidate so that the component can be invalidated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the picker gets opened or closed this. _isPickerOpen is mutated, which invalidates the ui5-datepicker, and this.isOpen() will return either true, or false when calculated for the HBS template upon rendering. (If that was the question)

@ilhan007 ilhan007 changed the title ACC implementation of DatePicker component feat(ui5-datepicker): implement ACC support Sep 4, 2019
}

get ariaHasPopup() {
if (this._accInfo && this._accInfo.ariaHasPopup) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do one check less, as undefined is fine:

if (this._accInfo) {
return this._accInfo.ariaHasPopup;
}

}

get ariaAutoComplete() {
if (this._accInfo && this._accInfo.ariaAutoComplete) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, you can do one check less, as undefined is fine:

if (this._accInfo) {
return this._accInfo. ariaAutoComplete;
}

return {
"wrapperAccInfo": {
},
"inputAccInfo": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AccInfo is already in the name of the main object, so "input" and "wrapper" are enough here
accInfo.input.role f.e.

"inputAccInfo": {
"ariaDescribedBy": this._inputAccInfo ? `${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 : () => { return this.showSuggestions ? "true" : undefined; },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO better to extract this as a const above
same for the other such lines, seems a bit too complex to read

?disabled="{{disabled}}"
?readonly="{{readonly}}"
value-state="{{valueState}}"
aria-autocomplete="none"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the aria stuff from the ui5-input

></ui5-calendar>
</ui5-popover>

<span id="{{_id}}-date" class="ui5-hidden-text">{{dateAriaDescription}}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not being read out when it is outside the native input DOM. We should add it in the same shadow root as the native input element

Copy link
Contributor

@elenastoyanovaa elenastoyanovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works as expected and it is being read out correctly. Just look at the comments, there are a few minor stuff which should be changed

@vladitasev vladitasev merged commit 188627e into UI5:master Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants