Skip to content

Commit ef5986c

Browse files
fix(ui5-shellbar): remove separators on mobile (#13107)
* fix(ui5-toolbar): remove separators on mobile * Delete packages/fiori/test/pages/img/SAP_R_grad_scrn 2.svg
1 parent 2d9fcff commit ef5986c

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

packages/fiori/cypress/specs/ShellBar.cy.tsx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,45 @@ describe("Slots", () => {
419419
.find("div[id='content-6'] > .ui5-shellbar-separator-end")
420420
.should("not.exist");
421421
});
422-
});
423422

423+
it("Should hide separators at S breakpoint regardless of content visibility", () => {
424+
cy.viewport(1920, 1080);
425+
426+
cy.mount(
427+
<ShellBar id="shellbar" primaryTitle="Product Title">
428+
<Button slot="content">Start Button 1</Button>
429+
<Button slot="content">Start Button 2</Button>
430+
<ShellBarSpacer slot="content" />
431+
<Button slot="content">End Button 1</Button>
432+
<Button slot="content">End Button 2</Button>
433+
</ShellBar>
434+
);
435+
436+
// At large viewport, separators should be visible
437+
cy.get("[ui5-shellbar]") // get the shellbar again to reset the DOM ref after remount
438+
.shadow()
439+
.find(".ui5-shellbar-content-items > .ui5-shellbar-separator-start")
440+
.should("exist");
441+
cy.get("[ui5-shellbar]")
442+
.shadow()
443+
.find(".ui5-shellbar-content-items > .ui5-shellbar-separator-end")
444+
.should("exist");
445+
446+
// Resize to S breakpoint (< 600px)
447+
cy.viewport(500, 1080);
448+
449+
// At S breakpoint, separators should be hidden even if content items are still visible
450+
cy.get("[ui5-shellbar]").should("have.prop", "breakpointSize", "S");
451+
cy.get("[ui5-shellbar]")
452+
.shadow()
453+
.find(".ui5-shellbar-content-items > .ui5-shellbar-separator-start")
454+
.should("not.exist");
455+
cy.get("[ui5-shellbar]")
456+
.shadow()
457+
.find(".ui5-shellbar-content-items > .ui5-shellbar-separator-end")
458+
.should("not.exist");
459+
});
460+
});
424461
describe("Search field slot", () => {
425462
it("Test search button is not visible when the search field slot is empty", () => {
426463
cy.mount(

packages/fiori/src/ShellBar.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,12 @@ class ShellBar extends UI5Element {
10051005
}
10061006

10071007
get separatorConfig() {
1008+
if (this.isSBreakPoint) {
1009+
return {
1010+
showStartSeparator: false,
1011+
showEndSeparator: false,
1012+
};
1013+
}
10081014
const { start, end } = this.splitContent(this.content);
10091015

10101016
return {

0 commit comments

Comments
 (0)