Skip to content

Commit

Permalink
feat: (CXSPA-9024) - Fix the issue where the focus only covers three …
Browse files Browse the repository at this point in the history
…sides of the 'Previous slide' and 'Next slide' buttons within the carousel section (#19719)
  • Loading branch information
petarmarkov9449 authored Dec 6, 2024
1 parent eb941e6 commit d5809c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,12 @@ export interface FeatureTogglesInterface {
*/
a11yDifferentiateFocusedAndSelected?: boolean;

/**
* Adds horizontal padding to the 'carousel-panel' to fix the issue where the focus only covers three sides of the 'Previous slide' and 'Next slide' buttons within the carousel section.
* Affects: CarouselComponent
*/
a11yAddPaddingToCarouselPanel?: boolean;

/**
* In OCC cart requests, it puts parameters of a cart name and cart description
* into a request body, instead of query params.
Expand Down Expand Up @@ -968,6 +974,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
a11yTableHeaderReadout: false,
a11ySearchboxAssistiveMessage: false,
a11yDifferentiateFocusedAndSelected: false,
a11yAddPaddingToCarouselPanel: false,
occCartNameAndDescriptionInHttpRequestBody: false,
cmsBottomHeaderSlotUsingFlexStyles: false,
useSiteThemeService: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ if (environment.cpq) {
a11yTableHeaderReadout: true,
a11ySearchboxAssistiveMessage: true,
a11yDifferentiateFocusedAndSelected: true,
a11yAddPaddingToCarouselPanel: true,
cmsBottomHeaderSlotUsingFlexStyles: true,
useSiteThemeService: false,
enableConsecutiveCharactersPasswordRequirement: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { LoggerService, useFeatureStyles } from '@spartacus/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
import { ICON_TYPE } from '../../../cms-components/misc/icon/icon.model';
import { CarouselService } from './carousel.service';
import { disableTabbingForTick } from '../../../layout/a11y';
import { CarouselService } from './carousel.service';

/**
* Generic carousel component that can be used to render any carousel items,
Expand Down Expand Up @@ -96,6 +96,7 @@ export class CarouselComponent implements OnInit, OnChanges {
protected service: CarouselService
) {
useFeatureStyles('a11yFocusableCarouselControls');
useFeatureStyles('a11yAddPaddingToCarouselPanel');
}

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
display: flex;
justify-content: space-between;

@include forFeature('a11yAddPaddingToCarouselPanel') {
padding: 0 0.375rem;
}

// TODO: (CXSPA-6904) - Remove feature flag next major release
@include forFeature('a11yFocusableCarouselControls') {
align-items: center;
Expand Down

0 comments on commit d5809c0

Please sign in to comment.