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

Close #13729

Closed
Closed

Close #13729

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
15 changes: 12 additions & 3 deletions src/app/components/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
PLATFORM_ID,
QueryList,
Renderer2,
SimpleChanges,
TemplateRef,
ViewChild,
ViewEncapsulation,
Expand Down Expand Up @@ -73,13 +74,13 @@ const hideAnimation = animation([animate('{{transition}}', style({ transform: '{
(@animation.start)="onAnimationStart($event)"
(@animation.done)="onAnimationEnd($event)"
role="dialog"
[attr.aria-labelledby]="getAriaLabelledBy()"
[attr.aria-labelledby]="ariaLabelledBy"
[attr.aria-modal]="true"
>
<div *ngIf="resizable" class="p-resizable-handle" style="z-index: 90;" (mousedown)="initResize($event)"></div>
<div #titlebar class="p-dialog-header" (mousedown)="initDrag($event)" *ngIf="showHeader">
<span [id]="getAriaLabelledBy()" class="p-dialog-title" *ngIf="!headerFacet && !headerTemplate">{{ header }}</span>
<span [id]="getAriaLabelledBy()" class="p-dialog-title" *ngIf="headerFacet">
<span [id]="ariaLabelledBy + '_title'" class="p-dialog-title" *ngIf="!headerFacet && !headerTemplate">{{ header }}</span>
<span [id]="ariaLabelledBy + '_title'" class="p-dialog-title" *ngIf="headerFacet">
<ng-content select="p-header"></ng-content>
</span>
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
Expand Down Expand Up @@ -464,6 +465,8 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {

dragging: boolean | undefined;

ariaLabelledBy: string | undefined;

documentDragListener: VoidListener;

documentDragEndListener: VoidListener;
Expand Down Expand Up @@ -554,6 +557,12 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
}
}

ngOnChanges(changes: SimpleChanges): void {
if (changes.header) {
this.ariaLabelledBy = this.getAriaLabelledBy();
}
}

getAriaLabelledBy() {
return this.header !== null ? UniqueComponentId() + '_header' : null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/fileupload/fileupload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDe
private http: HttpClient,
public cd: ChangeDetectorRef,
public config: PrimeNGConfig
) { }
) {}

ngAfterContentInit() {
this.templates?.forEach((item) => {
Expand Down Expand Up @@ -901,4 +901,4 @@ export class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDe
exports: [FileUpload, SharedModule, ButtonModule, ProgressBarModule, MessagesModule],
declarations: [FileUpload]
})
export class FileUploadModule { }
export class FileUploadModule {}
2 changes: 1 addition & 1 deletion src/app/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ export class Menu implements OnDestroy {
changeFocusedOptionIndex(index) {
const links = DomHandler.find(this.containerViewChild.nativeElement, 'li[data-pc-section="menuitem"][data-p-disabled="false"]');

if(links.length > 0) {
if (links.length > 0) {
let order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
order > -1 && this.focusedOptionIndex.set(links[order].getAttribute('id'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class TieredMenuSub {

@ViewChild('sublist', { static: true }) sublistViewChild: ElementRef;

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public renderer: Renderer2, private cd: ChangeDetectorRef,@Inject(forwardRef(() => TieredMenu)) public tieredMenu: TieredMenu) {}
constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public renderer: Renderer2, private cd: ChangeDetectorRef, @Inject(forwardRef(() => TieredMenu)) public tieredMenu: TieredMenu) {}

positionSubmenu() {
let sublist = this.sublistViewChild && this.sublistViewChild.nativeElement;
Expand Down
6 changes: 3 additions & 3 deletions src/app/showcase/doc/carousel/circulardoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ProductService } from '../../service/productservice';
<p>When <i>autoplayInterval</i> is defined in milliseconds, items are scrolled automatically. In addition, for infinite scrolling <i>circular</i> property needs to be added which is enabled automatically in auto play mode.</p>
</app-docsectiontext>
<div class="card">
<p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="true" [responsiveOptions]="responsiveOptions" autoPlayInterval="3000">
<p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="true" [responsiveOptions]="responsiveOptions" autoplayInterval="3000">
<ng-template let-product pTemplate="item">
<div class="border-1 surface-border border-round m-2 text-center py-5 px-3">
<div class="mb-3">
Expand Down Expand Up @@ -81,7 +81,7 @@ export class CircularDoc implements OnInit {

code: Code = {
basic: `
<p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="true" [responsiveOptions]="responsiveOptions" autoPlayInterval="3000">
<p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="true" [responsiveOptions]="responsiveOptions" autoplayInterval="3000">
<ng-template let-product pTemplate="item">
<div class="border-1 surface-border border-round m-2 text-center py-5 px-3">
<div class="mb-3">
Expand All @@ -101,7 +101,7 @@ export class CircularDoc implements OnInit {
</p-carousel>`,
html: `
<div class="card">
<p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="true" [responsiveOptions]="responsiveOptions" autoPlayInterval="3000">
<p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="true" [responsiveOptions]="responsiveOptions" autoplayInterval="3000">
<ng-template let-product pTemplate="item">
<div class="border-1 surface-border border-round m-2 text-center py-5 px-3">
<div class="mb-3">
Expand Down