Skip to content

Commit f17cba3

Browse files
authored
fix(ui5-flexible-column-layout): Fix media breakpoints (#1984)
The media breakpoints are now aligned with the Fiori 3 specs. Related to: #1972
1 parent 0ffca82 commit f17cba3

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

packages/fiori/src/FlexibleColumnLayout.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ class FlexibleColumnLayout extends UI5Element {
239239

240240
static get BREAKPOINTS() {
241241
return {
242-
"M": 960,
243-
"L": 1280,
242+
"PHONE": 599,
243+
"TABLET": 1023,
244244
};
245245
}
246246

@@ -563,11 +563,11 @@ class FlexibleColumnLayout extends UI5Element {
563563
}
564564

565565
get media() {
566-
if (this._width <= FlexibleColumnLayout.BREAKPOINTS.M) {
566+
if (this._width <= FlexibleColumnLayout.BREAKPOINTS.PHONE) {
567567
return FlexibleColumnLayout.MEDIA.PHONE;
568568
}
569569

570-
if (this._width <= FlexibleColumnLayout.BREAKPOINTS.L) {
570+
if (this._width <= FlexibleColumnLayout.BREAKPOINTS.TABLET) {
571571
return FlexibleColumnLayout.MEDIA.TABLET;
572572
}
573573

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

+9-8
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ describe("FlexibleColumnLayout Behavior", () => {
2020
assert.strictEqual(layoutChangeCounter.getValue(), "1", "The event layout-change is not fired.");
2121
});
2222

23-
it("tests Tablet Size 1200px", () => {
23+
it("tests Tablet Size 1000px", () => {
2424
// act
25-
browser.setWindowSize(1200, 1080);
25+
browser.setWindowSize(1000, 1080);
2626

2727
const layoutChangeCounter = browser.$("#testLayoutChange");
2828
const visibleColumns = browser.execute(() => {
@@ -35,9 +35,9 @@ describe("FlexibleColumnLayout Behavior", () => {
3535
assert.strictEqual(layoutChangeCounter.getValue(), "2", "The event layout-change after resizing.");
3636
});
3737

38-
it("tests Phone size 870px", () => {
38+
it("tests Phone size 500px", () => {
3939
// act
40-
browser.setWindowSize(870, 1080);
40+
browser.setWindowSize(500, 1080);
4141

4242
const layoutChangeCounter = browser.$("#testLayoutChange");
4343
const visibleColumns = browser.execute(() => {
@@ -57,19 +57,20 @@ describe("FlexibleColumnLayout Behavior", () => {
5757
const fcl = browser.$("#fcl1");
5858
const layoutChangeCounter = browser.$("#layoutChangeRes4");
5959
const arrow = fcl.shadow$(".ui5-fcl-arrow--start");
60+
let counter = parseInt(layoutChangeCounter.getValue()) || 0;
6061

6162
// act
6263
arrow.click();
6364

64-
// assert (two times the event has been fired due resize already)
65-
assert.strictEqual(layoutChangeCounter.getValue(), "4", "The event layout-change fired once.");
65+
// assert
66+
assert.strictEqual(layoutChangeCounter.getValue(), `${++counter}`, "The event layout-change fired once.");
6667
assert.strictEqual(fcl.getProperty("layout"), "TwoColumnsMidExpanded", "new layout set");
6768

6869
// act
6970
arrow.click();
7071

71-
// // assert
72-
assert.strictEqual(layoutChangeCounter.getValue(), "5", "The event layout-change fired again.");
72+
// assert
73+
assert.strictEqual(layoutChangeCounter.getValue(), `${++counter}`, "The event layout-change fired again.");
7374
assert.strictEqual(fcl.getProperty("layout"), "TwoColumnsStartExpanded", "new layout set");
7475
});
7576

0 commit comments

Comments
 (0)