Skip to content

Commit ac6e8d2

Browse files
authored
fix(ui5-button): make aria-labelledby work with numeric id (#1500)
1 parent b0195b7 commit ac6e8d2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/main/src/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class Button extends UI5Element {
338338
let result = "";
339339

340340
ids.forEach((elementId, index) => {
341-
const element = owner.querySelector(`#${elementId}`);
341+
const element = owner.querySelector(`[id='${elementId}']`);
342342
result += `${element ? element.textContent : ""}`;
343343

344344
if (index < ids.length - 1) {

packages/main/test/pages/Button.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
<br />
7070
<br />
7171

72-
<ui5-label id="download-text">Download Application</ui5-label>
72+
<ui5-label id="1download-text">Download Application</ui5-label>
7373
<ui5-label id="download-text2">From This Button</ui5-label>
74-
<ui5-button icon="employee" aria-labelledby="download-text download-text2">Action Bar Button</ui5-button>
75-
<ui5-button icon="download" aria-labelledby="download-text"></ui5-button>
74+
<ui5-button icon="employee" aria-labelledby="1download-text download-text2">Action Bar Button</ui5-button>
75+
<ui5-button icon="download" aria-labelledby="1download-text"></ui5-button>
7676

7777

7878
<br/>

0 commit comments

Comments
 (0)