Skip to content

Commit 294f665

Browse files
committed
test(ac): hide during animation
1 parent 60820bb commit 294f665

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

core/src/components/action-sheet/action-sheet.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,18 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
201201
async present(): Promise<void> {
202202
const unlock = await this.lockController.lock();
203203

204+
// hide from screen readers before animating
205+
// this is to avoid reading the action sheet content
206+
// before it's fully visible
207+
this.el.setAttribute('aria-hidden', 'true');
208+
204209
await this.delegateController.attachViewToDom();
205210

206211
await present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
207212

213+
// show to screen readers after animation
214+
this.el.removeAttribute('aria-hidden');
215+
208216
unlock();
209217
}
210218

core/src/components/action-sheet/animations/md.enter.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ export const mdEnterAnimation = (baseEl: HTMLElement): Animation => {
2020

2121
wrapperAnimation
2222
.addElement(baseEl.querySelector('.action-sheet-wrapper')!)
23-
.keyframes([
24-
{ offset: 0, transform: 'translateY(100%)' },
25-
{ offset: 1, transform: 'translateY(0%)' }
26-
]);
23+
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
2724

2825
return baseAnimation
2926
.addElement(baseEl)

core/src/components/action-sheet/animations/md.leave.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ export const mdLeaveAnimation = (baseEl: HTMLElement): Animation => {
1414

1515
wrapperAnimation
1616
.addElement(baseEl.querySelector('.action-sheet-wrapper')!)
17-
.keyframes([
18-
{ offset: 0, transform: 'translateY(0%)' },
19-
{ offset: 1, transform: 'translateY(100%)' }
20-
]);
17+
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
2118

2219
return baseAnimation
2320
.addElement(baseEl)

0 commit comments

Comments
 (0)