Skip to content

Commit

Permalink
fix(stepper): remove delay in focus to next step (#1564)
Browse files Browse the repository at this point in the history
## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: [CDE-2295](https://vmw-jira.broadcom.com/browse/CDE-2295)

## What is the new behavior?

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below. -->

## Other information
Reverted the fix made for A11y issue
[CDE-699](https://vmw-jira.broadcom.com/browse/CDE-699)

---------

Co-authored-by: Andrea Fernandes <[email protected]>
Co-authored-by: Daniel Tsanev <[email protected]>
  • Loading branch information
3 people authored Oct 2, 2024
1 parent 086a45a commit 1c359f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions projects/angular/src/accordion/stepper/stepper-panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Component, Injectable, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
Expand Down Expand Up @@ -121,7 +121,6 @@ describe('ClrStep Reactive Forms', () => {
expect(input.focus).not.toHaveBeenCalled();

(stepperService as MockStepperService).activeStep.next('groupName');
tick(1500);

expect(input.focus).toHaveBeenCalled();
}));
Expand Down
4 changes: 1 addition & 3 deletions projects/angular/src/accordion/stepper/stepper-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ export class ClrStepperPanel extends ClrAccordionPanel implements OnInit {
this.stepperService.activeStep
.pipe(filter(panelId => isPlatformBrowser(this.platformId) && panelId === this.id))
.subscribe(() => {
//Adding timeout so that the status of the previous step is read by Voice Over on Safari,
//before focusing on the next stepper panel header
setTimeout(() => this.headerButton.nativeElement.focus(), 1500);
this.headerButton.nativeElement.focus();
})
);
}
Expand Down

0 comments on commit 1c359f2

Please sign in to comment.