-
Notifications
You must be signed in to change notification settings - Fork 273
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
Conversation
packages/fiori/src/Timeline.js
Outdated
@@ -115,7 +127,7 @@ class Timeline extends UI5Element { | |||
} | |||
|
|||
get ariaLabel() { | |||
return Timeline.i18nBundle.getText(TIMELINE_ARIA_LABEL); | |||
return getEffectiveAriaLabelText(this); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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);
}
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
packages/fiori/src/Timeline.js
Outdated
@@ -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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this 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.
add new property "accessibleName"
FIXES: #4644