Skip to content

Commit

Permalink
refactor(ui5-li, ui5-list): changes accessibleRole type
Browse files Browse the repository at this point in the history
  • Loading branch information
yanaminkova committed Apr 23, 2024
1 parent e70817f commit b4e6354
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/List.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<ul id="{{_id}}-listUl"
class="ui5-list-ul"
role="{{_accessibleRole}}"
role="{{listAccessibleRole}}"
aria-label="{{ariaLabelTxt}}"
aria-labelledby="{{ariaLabelledBy}}"
aria-roledescription="{{accessibleRoleDescription}}"
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ class List extends UI5Element {
};
}

get _accessibleRole() {
get listAccessibleRole() {
return this.accessibleRole.toLowerCase();
}

Expand Down
6 changes: 3 additions & 3 deletions packages/main/src/ListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ abstract class ListItem extends ListItemBase {
return undefined;
}

get _accessibleRole() {
return this.accessibleRole.toLowerCase();
get listItemAccessibleRole() {
return this.accessibleRole?.toLowerCase();
}

get ariaSelectedText() {
Expand Down Expand Up @@ -518,7 +518,7 @@ abstract class ListItem extends ListItemBase {

get _accInfo(): AccInfo {
return {
role: this._accessibleRole || this.role,
role: this.listItemAccessibleRole || this.role,
ariaExpanded: undefined,
ariaLevel: undefined,
ariaLabel: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_CHECKBOX),
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/types/ListAccessibleRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ enum ListAccessibleRole {
* Represents the ARIA role "list". (by default)
* @public
*/
List = "list",
List = "List",

/**
* Represents the ARIA role "menu".
* @public
*/
Menu = "menu",
Menu = "Menu",

/**
* Represents the ARIA role "tree".
* @public
*/
Tree = "tree",
Tree = "Tree",

/**
* Represents the ARIA role "listbox".
* @public
*/
Listbox = "listbox"
ListBox = "ListBox"

}

Expand Down
10 changes: 5 additions & 5 deletions packages/main/src/types/ListItemAccessibleRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ enum ListItemAccessibleRole {
* Represents the ARIA role "listitem". (by default)
* @public
*/
ListItem = "listitem",
ListItem = "ListItem",

/**
* Represents the ARIA role "menuitem".
* @public
*/
MenuItem = "menuitem",
MenuItem = "MenuItem",

/**
* Represents the ARIA role "treeitem".
* @public
*/
TreeItem = "treeitem",
TreeItem = "TreeItem",

/**
* Represents the ARIA role "option".
* @public
*/
Option = "option",
Option = "Option",

/**
* Represents the ARIA role "none".
* @public
*/
None = "none"
None = "None"

}

Expand Down

0 comments on commit b4e6354

Please sign in to comment.