Skip to content

Commit

Permalink
fix: disable tabbing for quick order search results list (#19742)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrozdsap authored Dec 16, 2024
1 parent db2941f commit 20bf785
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
class="quick-order-results-product-container"
>
<button
*cxFeature="'!a11yQuickOrderSearchListKeyboardNavigation'"
(blur)="onBlur($event)"
(mousedown)="add(product, $event)"
(keydown.arrowdown)="focusNextChild($event)"
Expand Down Expand Up @@ -103,6 +104,42 @@
</span>
<span class="price">{{ product.price?.formattedValue }}</span>
</button>
<button
*cxFeature="'a11yQuickOrderSearchListKeyboardNavigation'"
(blur)="onBlur($event)"
(mousedown)="add(product, $event)"
(keydown.arrowdown)="focusNextChild($event)"
(keydown.arrowup)="focusPreviousChild($event)"
(keydown.enter)="add(product, $event)"
(keydown.escape)="clear($event)"
(keydown.tab)="close()"
(keydown.shift.tab)="close()"
[class.has-media]="
config?.quickOrder?.searchForm?.displayProductImages
"
class="quick-order-results-product"
role="option"
>
<cx-media
*ngIf="config?.quickOrder?.searchForm?.displayProductImages"
[alt]="product.name"
[container]="product.images?.PRIMARY"
class="media"
format="thumbnail"
role="presentation"
></cx-media>
<div class="name" [innerHTML]="product.name"></div>
<span class="id">
{{
'quickOrderForm.id'
| cxTranslate
: {
id: product.code,
}
}}
</span>
<span class="price">{{ product.price?.formattedValue }}</span>
</button>
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ export interface FeatureTogglesInterface {
*/
a11yMobileFocusOnFirstNavigationItem?: boolean;

/**
* `QuickOrderFormComponent` - disable navigation with Tab/Shift+Tab for search results list
*/
a11yQuickOrderSearchListKeyboardNavigation?: boolean;

/**
* Corrects heading order inside 'OrderSummaryComponent' template.
*/
Expand Down Expand Up @@ -943,6 +948,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
a11yListOversizedFocus: true,
a11yStoreFinderOverflow: true,
a11yMobileFocusOnFirstNavigationItem: false,
a11yQuickOrderSearchListKeyboardNavigation: false,
a11yCartSummaryHeadingOrder: true,
a11ySearchBoxMobileFocus: true,
a11yFacetKeyboardNavigation: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ if (environment.cpq) {
a11yListOversizedFocus: true,
a11yStoreFinderOverflow: true,
a11yMobileFocusOnFirstNavigationItem: true,
a11yQuickOrderSearchListKeyboardNavigation: false,
a11yCartSummaryHeadingOrder: true,
a11ySearchBoxMobileFocus: true,
a11yFacetKeyboardNavigation: true,
Expand Down

0 comments on commit 20bf785

Please sign in to comment.