Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui5-datepicker): implement ACC support #763

Merged
merged 23 commits into from
Sep 10, 2019
Merged

feat(ui5-datepicker): implement ACC support #763

merged 23 commits into from
Sep 10, 2019

Conversation

tsanislavgatev
Copy link
Contributor

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

return this.showSuggestions ? "list" : undefined;
}

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

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

@@ -46,6 +51,6 @@
@ui5-selectedDatesChange="{{_calendar.onSelectedDatesChange}}"
></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

@@ -25,6 +25,12 @@ BUTTON_ARIA_TYPE_REJECT=Negative Action
#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

@@ -25,6 +25,12 @@ BUTTON_ARIA_TYPE_REJECT=Negative Action
#XACT: ARIA announcement for the emphasized button
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
Member

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
return `${this.suggestionsTextId} ${this.valueStateTextId}`.trim();
}

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

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;
}

return this.showSuggestions ? "true" : undefined;
}

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

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

@@ -11,16 +11,21 @@
?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

@@ -46,6 +51,6 @@
@ui5-selectedDatesChange="{{_calendar.onSelectedDatesChange}}"
></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 SAP: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.

None yet

4 participants