Skip to content

Commit 9c94fb5

Browse files
ZeyberRadhepS
andauthored
Revert "fix: elevate scroll to top button when overlaps with banner (CXSPA-9067)" (#19749)
Co-authored-by: Radhep Sabapathipillai <[email protected]>
1 parent 849ba77 commit 9c94fb5

File tree

6 files changed

+2
-42
lines changed

6 files changed

+2
-42
lines changed

Diff for: projects/core/src/features-config/feature-toggles/config/feature-toggles.ts

-7
Original file line numberDiff line numberDiff line change
@@ -840,12 +840,6 @@ export interface FeatureTogglesInterface {
840840
*/
841841
showRealTimeStockInPDP?: boolean;
842842

843-
/**
844-
* When enabled, the scroll-to-top button adjusts its position when other UI elements
845-
* (like cookie consent banner) appear at the bottom of the page to prevent overlapping
846-
*/
847-
a11yScrollToTopPositioning?: boolean;
848-
849843
/**
850844
* Creates a section element with applied aria-label in "Review Order" page of the checkout.
851845
* Moves components to be children of this section element.
@@ -983,7 +977,6 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
983977
allPageMetaResolversEnabledInCsr: false,
984978
a11yPdpGridArrangement: false,
985979
useExtendedMediaComponentConfiguration: false,
986-
a11yScrollToTopPositioning: false,
987980
showRealTimeStockInPDP: false,
988981
enableSecurePasswordValidation: false,
989982
};

Diff for: projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts

-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ if (environment.cpq) {
415415
allPageMetaResolversEnabledInCsr: true,
416416
a11yPdpGridArrangement: true,
417417
useExtendedMediaComponentConfiguration: true,
418-
a11yScrollToTopPositioning: true,
419418
showRealTimeStockInPDP: false,
420419
a11yWrapReviewOrderInSection: true,
421420
enableSecurePasswordValidation: true,

Diff for: projects/storefrontlib/cms-components/navigation/scroll-to-top/scroll-to-top.component.html

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[attr.aria-label]="'navigation.scrollToTop' | cxTranslate"
44
[title]="'navigation.scrollToTop' | cxTranslate"
55
class="cx-scroll-to-top-btn"
6-
[class.elevated-position]="elevatedPosition$ | async"
76
(click)="scrollToTop($event)"
87
(focusout)="onFocusOut()"
98
(keydown.Tab)="onTab($event)"

Diff for: projects/storefrontlib/cms-components/navigation/scroll-to-top/scroll-to-top.component.spec.ts

-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { DebugElement } from '@angular/core';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
44
import {
5-
AnonymousConsentsService,
65
CmsScrollToTopComponent,
76
FeatureConfigService,
87
I18nTestingModule,
@@ -29,12 +28,6 @@ class MockFeatureConfigService {
2928
}
3029
}
3130

32-
class MockAnonymousConsentsService {
33-
isBannerVisible() {
34-
return of(false);
35-
}
36-
}
37-
3831
describe('ScrollToTopComponent', () => {
3932
let component: ScrollToTopComponent;
4033
let fixture: ComponentFixture<ScrollToTopComponent>;
@@ -55,10 +48,6 @@ describe('ScrollToTopComponent', () => {
5548
provide: FeatureConfigService,
5649
useClass: MockFeatureConfigService,
5750
},
58-
{
59-
provide: AnonymousConsentsService,
60-
useClass: MockAnonymousConsentsService,
61-
},
6251
],
6352
}).compileComponents();
6453

Diff for: projects/storefrontlib/cms-components/navigation/scroll-to-top/scroll-to-top.component.ts

+2-16
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ import {
2020
FeatureConfigService,
2121
ScrollBehavior,
2222
WindowRef,
23-
AnonymousConsentsService,
24-
useFeatureStyles,
2523
} from '@spartacus/core';
26-
import { take, Observable } from 'rxjs';
24+
import { take } from 'rxjs/operators';
2725
import { CmsComponentData } from '../../../cms-structure/page/model/cms-component-data';
2826
import { SelectFocusUtility } from '../../../layout/a11y/index';
2927
import { ICON_TYPE } from '../../misc/icon/icon.model';
@@ -39,7 +37,6 @@ export class ScrollToTopComponent implements OnInit {
3937
@HostBinding('class.display')
4038
display: boolean | undefined;
4139

42-
protected elevatedPosition$: Observable<boolean> | undefined;
4340
protected window: Window | undefined = this.winRef.nativeWindow;
4441
protected scrollBehavior: ScrollBehavior = ScrollBehavior.SMOOTH;
4542
protected displayThreshold: number = (this.window?.innerHeight ?? 400) / 2;
@@ -52,26 +49,15 @@ export class ScrollToTopComponent implements OnInit {
5249
@Optional() protected featureConfigService = inject(FeatureConfigService, {
5350
optional: true,
5451
});
55-
@Optional() protected anonymousConsentsService = inject(
56-
AnonymousConsentsService,
57-
{
58-
optional: true,
59-
}
60-
);
6152

6253
constructor(
6354
protected winRef: WindowRef,
6455
protected componentData: CmsComponentData<CmsScrollToTopComponent>,
6556
protected selectFocusUtility: SelectFocusUtility
66-
) {
67-
useFeatureStyles('a11yScrollToTopPositioning');
68-
}
57+
) {}
6958

7059
ngOnInit(): void {
7160
this.setConfig();
72-
if (this.featureConfigService?.isEnabled('a11yScrollToTopPositioning')) {
73-
this.elevatedPosition$ = this.anonymousConsentsService?.isBannerVisible();
74-
}
7561
}
7662

7763
@HostListener('window:scroll', ['$event'])

Diff for: projects/storefrontstyles/scss/components/content/navigation/_scroll-to-top.scss

-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
animation: popup 1s 1;
1313
}
1414

15-
@include forFeature('a11yScrollToTopPositioning') {
16-
&:has(.elevated-position) {
17-
bottom: 180px;
18-
}
19-
}
20-
2115
button {
2216
height: inherit;
2317
width: inherit;

0 commit comments

Comments
 (0)