Skip to content

Commit 89d84c6

Browse files
committed
MC-5419: Background Attachment Fixed Does Not Work In Mobile Android or iPhone on Storefront
- turn off background-attachment fixed in mobile due to partial device support - add test coverage for existing test
1 parent ece4477 commit 89d84c6

File tree

7 files changed

+58
-0
lines changed

7 files changed

+58
-0
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderBackgroundFormAttributeTests.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,6 +3235,7 @@
32353235
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
32363236
</before>
32373237
<after>
3238+
<resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/>
32383239
<actionGroup ref="navigateToMediaGallery" stepKey="navigateToMediaGallery"/>
32393240
<actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder">
32403241
<argument name="FolderName" value="{{PageBuilderBackgroundImage_JPG.path}}"/>
@@ -3311,5 +3312,13 @@
33113312
<argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/>
33123313
<argument name="pageNamePrefix" value="banner"/>
33133314
</actionGroup>
3315+
<resizeWindow width="767" height="1000" stepKey="resizeWindowToMobile"/>
3316+
<!-- Storefront: Check Background Attachment Mobile -->
3317+
<comment userInput="Storefront: Check Background Attachment Mobile" stepKey="commentStorefrontCheckMobile"/>
3318+
<executeJS function="return jQuery({{BannerOnFrontend.wrapperJS('1')}}).css('background-attachment')" stepKey="assignedBackgroundAttachment" />
3319+
<assertEquals stepKey="assertEqualToEnteredValue">
3320+
<expectedResult type="string">{{PageBuilderBackgroundAttachment_Scroll.value}}</expectedResult>
3321+
<actualResult type="variable">$assignedBackgroundAttachment</actualResult>
3322+
</assertEquals>
33143323
</test>
33153324
</tests>

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/banner/_default.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565

6666
@media only screen and (max-width: @screen__m) {
6767
.pagebuilder-banner-wrapper {
68+
background-attachment: scroll !important;
69+
6870
.pagebuilder-overlay:not(.pagebuilder-poster-overlay) {
6971
max-width: none;
7072
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/column/_default.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111
box-sizing: border-box;
1212
}
1313

14+
//
15+
// Responsive Classes
16+
// _____________________________________________
17+
1418
@media only screen and (max-width: @screen__m) {
1519
.pagebuilder-column {
20+
background-attachment: scroll !important;
1621
flex-basis: 100%;
1722
}
1823
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/row/_contained.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@
1717
box-sizing: border-box;
1818
}
1919
}
20+
21+
//
22+
// Responsive Classes
23+
// _____________________________________________
24+
25+
@media only screen and (max-width: @screen__m) {
26+
[data-role='row'][data-appearance='contained'] {
27+
[data-element='inner'] {
28+
background-attachment: scroll !important;
29+
}
30+
}
31+
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/row/_full-bleed.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@
1010
[data-role='row'][data-appearance='full-bleed'] {
1111
box-sizing: border-box;
1212
}
13+
14+
//
15+
// Responsive Classes
16+
// _____________________________________________
17+
18+
@media only screen and (max-width: @screen__m) {
19+
[data-role='row'][data-appearance='full-bleed'] {
20+
background-attachment: scroll !important;
21+
}
22+
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/row/_full-width.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@
1818
width: 100%;
1919
}
2020
}
21+
22+
//
23+
// Responsive Classes
24+
// _____________________________________________
25+
26+
@media only screen and (max-width: @screen__m) {
27+
[data-role='row'][data-appearance='full-width'] {
28+
background-attachment: scroll !important;
29+
}
30+
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/tabs/_default.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,13 @@ div[data-role='tabs'] {
102102
}
103103
}
104104
}
105+
106+
//
107+
// Responsive Classes
108+
// _____________________________________________
109+
110+
@media only screen and (max-width: @screen__m) {
111+
[data-role='tab-item'] {
112+
background-attachment: scroll !important;
113+
}
114+
}

0 commit comments

Comments
 (0)