Skip to content

Commit 5526dea

Browse files
authored
feat: stable-dom-ref supported for abstract items (#4604)
1 parent 9a16d61 commit 5526dea

File tree

10 files changed

+17
-10
lines changed

10 files changed

+17
-10
lines changed

packages/base/hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9Cw2r3iroIa9+t3zf9W9NFHa8/I=
1+
lg+vUkF4ZlVbMOpRYDqgaTP5Rvc=

packages/fiori/src/ShellBarItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ShellBarItem extends UI5Element {
8282
}
8383

8484
get stableDomRef() {
85-
return `${this._id}-stable-dom-ref`;
85+
return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
8686
}
8787
}
8888

packages/fiori/test/pages/ShellBar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
secondary-title="Second Title"
5555
id="shellbarwithitems"
5656
>
57-
<ui5-shellbar-item icon="accelerated" text="Hello World!" title="Schedule"></ui5-shellbar-item>
58-
<ui5-shellbar-item id="accept" icon="accept" text="Hello World!" title="Approve"></ui5-shellbar-item>
57+
<ui5-shellbar-item icon="accelerated" text="Hello World!" title="Schedule" stable-dom-ref="schedule"></ui5-shellbar-item>
58+
<ui5-shellbar-item id="accept" icon="accept" text="Hello World!" title="Approve" stable-dom-ref="accept"></ui5-shellbar-item>
5959
<ui5-shellbar-item id="warning" icon="alert" text="Hello World!" title="Warning"></ui5-shellbar-item>
6060
<ui5-shellbar-item icon="discussion" text="Hello World!" count="42" title="42 Messages"></ui5-shellbar-item>
6161
<ui5-shellbar-item icon="error" text="Hello World!" title="Attention"></ui5-shellbar-item>

packages/fiori/test/specs/ShellBar.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ describe("Component Behavior", () => {
5757

5858

5959
describe("ui5-shellbar-item", async () => {
60+
it("tests the stable-dom-ref attribute", async () => {
61+
const shellbar = await browser.$("#shellbarwithitems");
62+
const innerButtonWithStableDomRef = await shellbar.shadow$(`[data-ui5-stable="schedule"]`);
63+
64+
assert.ok(await innerButtonWithStableDomRef.isExisting(), "There is indeed an element in the Shellbar's shadow root with an attribute, matching the stable dom ref");
65+
});
66+
6067
it("tests count property", async () => {
6168
const shellbar = await browser.$("#shellbarwithitems");
6269
const icon = await shellbar.shadow$("ui5-button[data-count]");

packages/main/src/BreadcrumbsItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class BreadcrumbsItem extends UI5Element {
9494
}
9595

9696
get stableDomRef() {
97-
return `${this._id}-stable-dom-ref`;
97+
return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
9898
}
9999
}
100100

packages/main/src/MultiComboBoxItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MultiComboBoxItem extends ComboBoxItem {
3434
}
3535

3636
get stableDomRef() {
37-
return `${this._id}-stable-dom-ref`;
37+
return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
3838
}
3939
}
4040

packages/main/src/Option.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Option extends UI5Element {
117117
}
118118

119119
get stableDomRef() {
120-
return `${this._id}-stable-dom-ref`;
120+
return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
121121
}
122122
}
123123

packages/main/src/Tab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Tab extends UI5Element {
196196
}
197197

198198
get stableDomRef() {
199-
return `${this._id}-stable-dom-ref`;
199+
return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
200200
}
201201

202202
/**

packages/main/src/TabSeparator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class TabSeparator extends UI5Element {
6363
}
6464

6565
get stableDomRef() {
66-
return `${this._id}-stable-dom-ref`;
66+
return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
6767
}
6868

6969
get stripPresentation() {

packages/theming/hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CQhk8M6oN0XzkZBkgImthR2kdTs=
1+
rZnyMTmoc2CFM82C+7zGHcw3GGY=

0 commit comments

Comments
 (0)