Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: (CXSPA-9545) - Ng-select layering fix #20059

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,12 @@ export interface FeatureTogglesInterface {
*/
a11yWrapReviewOrderInSection?: boolean;

/**
* Fixes layering issues caused by native ng-select styles.
* Sets the dropdown's z-index property to be more in line with Spartacus.
*/
a11yNgSelectLayering?: boolean;

/**
* Enables the product carousel to include products based on specified category codes.
*
Expand Down Expand Up @@ -1136,6 +1142,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
useExtendedMediaComponentConfiguration: false,
showRealTimeStockInPDP: false,
a11yScrollToTopPositioning: false,
a11yNgSelectLayering: false,
enableSecurePasswordValidation: false,
enableCarouselCategoryProducts: false,
enableClaimCustomerCouponWithCodeInRequestBody: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ if (environment.cpq) {
showRealTimeStockInPDP: false,
a11yScrollToTopPositioning: false,
a11yWrapReviewOrderInSection: true,
a11yNgSelectLayering: true,
enableCarouselCategoryProducts: true,
enableSecurePasswordValidation: true,
enableClaimCustomerCouponWithCodeInRequestBody: false,
Expand Down
9 changes: 5 additions & 4 deletions projects/storefrontlib/layout/main/storefront.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { DOCUMENT } from '@angular/common';
import {
Component,
DestroyRef,
Expand All @@ -16,23 +17,22 @@ import {
Optional,
ViewChild,
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import {
FeatureConfigService,
RoutingService,
useFeatureStyles,
} from '@spartacus/core';
import { Observable, Subscription, tap } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
import {
FocusConfig,
SkipFocusConfig,
KeyboardFocusService,
SkipFocusConfig,
} from '../a11y/keyboard-focus/index';
import { SkipLinkComponent, SkipLinkService } from '../a11y/skip-link/index';
import { HamburgerMenuService } from '../header/hamburger-menu/hamburger-menu.service';
import { StorefrontOutlets } from './storefront-outlets.model';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { distinctUntilChanged } from 'rxjs/operators';
import { DOCUMENT } from '@angular/common';

@Component({
selector: 'cx-storefront',
Expand Down Expand Up @@ -103,6 +103,7 @@ export class StorefrontComponent implements OnInit, OnDestroy {
useFeatureStyles('headerLayoutForSmallerViewports');
useFeatureStyles('a11yPdpGridArrangement');
useFeatureStyles('a11yKeyboardFocusInSearchBox');
useFeatureStyles('a11yNgSelectLayering');
}

ngOnInit(): void {
Expand Down
7 changes: 7 additions & 0 deletions projects/storefrontstyles/scss/cxbase/blocks/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,13 @@ input[type='radio'] {
}
}

ng-select.ng-select.ng-select-opened .ng-select-container,
ng-select .ng-dropdown-panel {
@include forFeature('a11yNgSelectLayering') {
z-index: 10;
}
}

:focus:not(main) {
@include visible-focus();
}
Expand Down
Loading