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-timeline): provide accessible-name support #4721

Merged
merged 4 commits into from
Feb 14, 2022

Conversation

Todor-ads
Copy link
Member

@Todor-ads Todor-ads commented Feb 9, 2022

add new property "accessibleName"

FIXES: #4644

@Todor-ads Todor-ads requested a review from unazko February 9, 2022 16:28
@@ -115,7 +127,7 @@ class Timeline extends UI5Element {
}

get ariaLabel() {
return Timeline.i18nBundle.getText(TIMELINE_ARIA_LABEL);
return getEffectiveAriaLabelText(this);
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need the TIMELINE_ARIA_LABEL as default in case accessibleName is not set?
If we don't - please explain in the commit message.

Copy link
Contributor

@unazko unazko Feb 10, 2022

Choose a reason for hiding this comment

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

This text results into "Timeline" and it describes the element context. Later on it could be moved into the aira-roledescription attribute as mentioned in the status page: https://wiki.wdf.sap.corp/wiki/pages/viewpage.action?pageId=2382053542
I think we need this text alongside the accessibleName text. At the end the upper status page could be updated.

Copy link
Member

Choose a reason for hiding this comment

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

The only thing to do is:

get ariaLabel() {
  return this.accessibleName || Timeline.i18nBundle.getText(TIMELINE_ARIA_LABEL);
}

Copy link
Contributor

@unazko unazko Feb 10, 2022

Choose a reason for hiding this comment

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

I was thinking for concatenation of those two. As "Timeline" could be treated as a roledescription and the accessible-name would be a text related to the specific context of the application.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -2,10 +2,10 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
import { isTabNext, isTabPrevious } from "@ui5/webcomponents-base/dist/Keys.js";
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
Copy link
Member

@ilhan007 ilhan007 Feb 10, 2022

Choose a reason for hiding this comment

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

The point of using the getEffectiveAriaLabelText method is to return the aria accessible name by checking the accessibleName and accessibleNameRef properties, but the Timeline has only accessibleName. The method won't break the code, but it's not needed and performs unneeded checks. You can directly use the accessibleName property.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@unazko unazko left a comment

Choose a reason for hiding this comment

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

It looks good from my point of view.

@Todor-ads Todor-ads requested review from ilhan007 and removed request for unazko February 11, 2022 13:08
@ilhan007 ilhan007 merged commit 0562e89 into master Feb 14, 2022
@ilhan007 ilhan007 deleted the time_line_accessable_name branch February 14, 2022 08:12
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.

[SF] [A11Y] [ui5-timeline] Add an accessibleName property to the Timeline
3 participants