From f8ee175ad785c9e83dc605d6e70fe31432dc6b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:17:08 +0300 Subject: [PATCH] Fixed #14949 - Dialog | Missing Aria Label on Maximize button --- src/app/components/api/primengconfig.ts | 3 ++- src/app/components/api/translation.ts | 1 + src/app/components/dialog/dialog.ts | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/components/api/primengconfig.ts b/src/app/components/api/primengconfig.ts index c096885cdc7..ac1e4d96c16 100644 --- a/src/app/components/api/primengconfig.ts +++ b/src/app/components/api/primengconfig.ts @@ -140,7 +140,8 @@ export class PrimeNGConfig { listLabel: 'Option List', selectColor: 'Select a color', removeLabel: 'Remove', - browseFiles: 'Browse Files' + browseFiles: 'Browse Files', + maximizeLabel: 'Maximize' } }; diff --git a/src/app/components/api/translation.ts b/src/app/components/api/translation.ts index bc7030211c0..2c43c19c9a6 100644 --- a/src/app/components/api/translation.ts +++ b/src/app/components/api/translation.ts @@ -131,4 +131,5 @@ export interface Aria { selectColor?: string; removeLabel?: string; browseFiles?: string; + maximizeLabel?: string; } diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index 81c6282a694..b6fe779c5fc 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -25,7 +25,7 @@ import { ViewEncapsulation, ViewRef } from '@angular/core'; -import { Footer, Header, PrimeNGConfig, PrimeTemplate, SharedModule } from 'primeng/api'; +import { Footer, Header, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api'; import { DomHandler } from 'primeng/dom'; import { FocusTrapModule } from 'primeng/focustrap'; import { TimesIcon } from 'primeng/icons/times'; @@ -101,6 +101,7 @@ const hideAnimation = animation([animate('{{transition}}', style({ transform: '{ (click)="maximize()" (keydown.enter)="maximize()" [attr.tabindex]="maximizable ? '0' : '-1'" + [attr.aria-label]="maximizeLabel" pRipple pButton > @@ -540,6 +541,10 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { private window: Window; + get maximizeLabel(): string { + return this.config.getTranslation(TranslationKeys.ARIA)['maximizeLabel']; + } + constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, public el: ElementRef, public renderer: Renderer2, public zone: NgZone, private cd: ChangeDetectorRef, public config: PrimeNGConfig) { this.window = this.document.defaultView as Window; }