Skip to content

Commit

Permalink
fix: (CXSPA-1129) - Mute form error icon (#18967)
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Estrada <[email protected]>
  • Loading branch information
Pio-Bar and developpeurweb authored Jul 11, 2024
1 parent 6645861 commit 8134ee3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ export interface FeatureTogglesInterface {
*/
a11yFacetsDialogFocusHandling?: boolean;

/**
* Stops the icon inside 'FormErrorsComponent' from being read out by screen readers.
*/
a11yFormErrorMuteIcon?: boolean;

/**
* `MessageComponent` gets focused after a message with an action is rendered.
*/
Expand Down Expand Up @@ -445,6 +450,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
a11yUseButtonsForBtnLinks: false,
a11yDisabledCouponAndQuickOrderActionButtonsInsteadOfRequiredFields: false,
a11yFacetsDialogFocusHandling: false,
a11yFormErrorMuteIcon: false,
a11yCxMessageFocus: false,
a11yLinkBtnsToTertiaryBtns: false,
a11yStoreFinderSearchboxBloat: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ if (environment.estimatedDeliveryDate) {
a11yDisabledCouponAndQuickOrderActionButtonsInsteadOfRequiredFields:
true,
a11yFacetsDialogFocusHandling: true,
a11yFormErrorMuteIcon: true,
a11yCxMessageFocus: true,
occCartNameAndDescriptionInHttpRequestBody: true,
a11yLinkBtnsToTertiaryBtns: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {
inject,
} from '@angular/core';
import { AbstractControl, UntypedFormControl } from '@angular/forms';
import { FeatureConfigService, isObject } from '@spartacus/core';
import {
FeatureConfigService,
isObject,
useFeatureStyles,
} from '@spartacus/core';
import { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators';

Expand All @@ -40,7 +44,9 @@ export class FormErrorsComponent implements DoCheck {
constructor(
protected ChangeDetectionRef: ChangeDetectorRef,
protected keyValueDiffers: KeyValueDiffers
) {}
) {
useFeatureStyles('a11yFormErrorMuteIcon');
}

_control: UntypedFormControl | AbstractControl;

Expand Down
4 changes: 4 additions & 0 deletions projects/storefrontstyles/scss/cxbase/blocks/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ cx-form-errors {

&::after {
content: '!';
// TODO: (CXSPA-7588) - Remove feature flag next major release
@include forFeature('a11yFormErrorMuteIcon') {
content: '!' / '';
}
color: var(--cx-color-inverse);
font-weight: var(--cx-font-weight-bold);
text-align: center;
Expand Down

0 comments on commit 8134ee3

Please sign in to comment.