Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@openui5/sap.ui.core": "1.120.17",
"@ui5/webcomponents-tools": "1.24.26",
"chromedriver": "^143.0.4",
"chromedriver": "^145.0.0",
"clean-css": "^5.2.2",
"copy-and-watch": "^0.1.5",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.24.26",
"chromedriver": "^143.0.4"
"chromedriver": "^145.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/localization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@openui5/sap.ui.core": "1.120.17",
"@ui5/webcomponents-tools": "1.24.26",
"babel-plugin-amd-to-esm": "^2.0.3",
"chromedriver": "^143.0.4",
"chromedriver": "^145.0.0",
"estree-walk": "^2.2.0",
"mkdirp": "^1.0.4",
"resolve": "^1.20.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.24.26",
"chromedriver": "^143.0.4"
"chromedriver": "^145.0.0"
}
}
4 changes: 3 additions & 1 deletion packages/main/src/Select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ interface IOption extends UI5Element {
text?: Array<Node>,
stableDomRef: string,
displayText?: string,
accessibleName?: string,
}

type SelectChangeEventDetail = {
Expand Down Expand Up @@ -1110,7 +1111,8 @@ class Select extends UI5Element implements IFormElement {
const itemPositionText = Select.i18nBundle.getText(LIST_ITEM_POSITION, this._selectedIndex + 1, optionsCount);

if (this.focused && this._currentlySelectedOption) {
text = `${this._currentlySelectedOption.textContent as string} ${this._isPickerOpen ? itemPositionText : ""}`;
const optionText = this._currentlySelectedOption.accessibleName || this._currentlySelectedOption.textContent as string;
text = `${optionText}${this._isPickerOpen ? `, ${itemPositionText}` : ""}`;

announce(text, InvisibleMessageMode.Polite);
}
Expand Down
16 changes: 16 additions & 0 deletions packages/main/test/specs/SelectMenu.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,20 @@ describe("Select Menu general interaction", () => {

assert.strictEqual(await inpTestChange.getProperty("value"), "1", "Change event should be fired after focus out");
});

it("Tests accessible-name on SelectMenuOption", async () => {
const menu = await browser.$("#selectOptions");
const options = await menu.$$("ui5-select-menu-option");

const EXPECTED_FIRST_OPTION_ACCESSIBLE_NAME = "T-shirt size S";
const EXPECTED_SECOND_OPTION_ACCESSIBLE_NAME = "Dress size M";
const EXPECTED_THIRD_OPTION_ACCESSIBLE_NAME = "Skirt size L";

assert.strictEqual(await options[0].getProperty("accessibleName"), EXPECTED_FIRST_OPTION_ACCESSIBLE_NAME,
"The accessible-name property on first ui5-select-menu-option is correctly set.");
assert.strictEqual(await options[1].getProperty("accessibleName"), EXPECTED_SECOND_OPTION_ACCESSIBLE_NAME,
"The accessible-name property on second ui5-select-menu-option is correctly set.");
assert.strictEqual(await options[2].getProperty("accessibleName"), EXPECTED_THIRD_OPTION_ACCESSIBLE_NAME,
"The accessible-name property on third ui5-select-menu-option is correctly set.");
});
});
Loading