Skip to content

Commit

Permalink
Merge pull request #16336 from primefaces/issue-16335
Browse files Browse the repository at this point in the history
Fixed #16335 - DynamicDialog | Closing nested dialog makes the underl…
  • Loading branch information
mehmetcetin01140 authored Sep 10, 2024
2 parents 41dd18b + 5f215ec commit c859aed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/app/components/dynamicdialog/dynamicdialog-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export class DynamicDialogConfig<T = any> {
* @group Props
*/
focusOnShow?: boolean = true;
/**
* Specifies if autofocus should happen on close.
* @group Props
*/
focusOnClose?: boolean = true;
/**
* When enabled, can only focus on elements inside the dialog.
* @group Props
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dynamicdialog/dynamicdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export class DynamicDialogComponent implements AfterViewInit, OnDestroy {

onAnimationEnd(event: AnimationEvent) {
if (event.toState === 'void') {
if (this.parentContent) {
if (this.parentContent && this.config.focusOnClose !== false) {
this.focus(this.parentContent);
}
this.onContainerDestroy();
Expand Down

0 comments on commit c859aed

Please sign in to comment.