-
Notifications
You must be signed in to change notification settings - Fork 280
feat(ui5-avatar): implement accessibilityInfo getter #12613
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
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Deployed on https://pr-12613--ui5-webcomponents-preview.netlify.app |
packages/main/src/Avatar.ts
Outdated
| }; | ||
| } | ||
|
|
||
| return undefined; |
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.
That means if the avatar is not interactive and placed within a table cell, it will be announced as "Empty". I'm not sure whether this is the expected behavior from an accessibility perspective.
packages/main/src/Avatar.ts
Outdated
| if (this._interactive) { | ||
| return { | ||
| role: this._role as AriaRole, | ||
| type: this._ariaHasPopup, |
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.
As mentioned in the other change, just like in UI5, the type should be translatable.
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.
Hello @aborjinik ,
thank you for your comments. Changes are still in progress.
I wonder regarding the roles - should they also be translatable? Like in this case role could be "button" or "img". But "img" should be read out as "Image" (best case) and there is no such AriaRole? What should we do in this case?
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.
Nevermind. I think I got it - table (and also customlistitem) will use only type, NOT ROLE, when they construct the string description of all acccessibilityInfo properties of a component.
In case component does not have specific "type" (like CheckBox has role=checkbox and that's it, "CheckBox" will be also returned as type but translatable). When component have different "type" than "role" (like in Avatar - it's role is Button or Img, but "type" can come from hasPopup /menu, listbox, etc/ - "type" will be the translatable value of "hasPopup". Or Select - "role" is "combobox", but more specific type is "listbox" -> listbox is returned as type, translatable).
related to #7729