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-9018) - Fix extra reading issue when tab-panel is focused in 'Delivery method' #19920

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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 @@ -170,12 +170,14 @@
{{ 'pickupOptions.legend' | cxTranslate }}
</div>

<cx-tab
*ngIf="tabs"
[disabled]="disableControls"
[tabs]="tabs"
[config]="tabConfig"
></cx-tab>
<div>
<cx-tab
*ngIf="tabs"
[disabled]="disableControls"
[tabs]="tabs"
[config]="tabConfig"
></cx-tab>
</div>
</div>
<div aria-live="assertive" aria-atomic="true">
<span *ngIf="validationError" tabindex="0" class="cx-invalid-message">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div
[attr.role]="mode === TAB_MODE.ACCORDIAN ? 'region' : 'tabpanel'"
[tabindex]="tab.disableBorderFocus ? -1 : 0"
[attr.aria-labelledby]="tab.id ?? null"
[attr.id]="
tab.id !== null && tab.id !== undefined ? 'section-' + tab.id : null
"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, TemplateRef, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { Tab, TAB_MODE } from '../tab.model';
import { TabPanelComponent } from './tab-panel.component';
import { KeyboardFocusTestingModule } from '@spartacus/storefront';
import { TAB_MODE, Tab } from '../tab.model';
import { TabPanelComponent } from './tab-panel.component';

const mockTab: Tab | any = {
id: 1,
Expand Down Expand Up @@ -46,7 +46,6 @@ describe('TabPanelComponent', () => {
expect(tabPanel?.getAttribute('tabindex')).toEqual('0');
expect(tabPanel?.getAttribute('role')).toEqual('tabpanel');
expect(tabPanel?.getAttribute('class')).toEqual('active');
expect(tabPanel?.getAttribute('aria-labelledby')).toEqual('1');
});

it('should have correct attribues when is open in ACCORDIAN mode', () => {
Expand All @@ -58,7 +57,6 @@ describe('TabPanelComponent', () => {
expect(tabPanel?.getAttribute('tabindex')).toEqual('0');
expect(tabPanel?.getAttribute('role')).toEqual('region');
expect(tabPanel?.getAttribute('class')).toEqual('active');
expect(tabPanel?.getAttribute('aria-labelledby')).toEqual('1');
});

it('should have correct attribues when disableBorderFocus is active', () => {
Expand Down