@firestitch/form 13.3.5 → 13.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -498,8 +498,10 @@ class FsFormDirective {
498
498
  .pipe(takeUntil(this._destroy$))
499
499
  .subscribe((event) => {
500
500
  if (this._dialogBackdropEscape && event.code === 'Escape') {
501
+ const cdkOverlayPane = Array
502
+ .from(document.querySelectorAll('.cdk-overlay-pane')).pop();
501
503
  const activeDialog = this
502
- ._activeDialog(document.activeElement, document.getElementById(this._dialogRef.id));
504
+ ._activeDialog(document.getElementById(this._dialogRef.id), cdkOverlayPane);
503
505
  if (activeDialog) {
504
506
  this._ngZone.run(() => {
505
507
  this._formClose();
@@ -692,36 +694,34 @@ class FsFormDirective {
692
694
  };
693
695
  }
694
696
  confirmTabGroup._handlClick$
695
- .pipe(takeUntil(this._destroy$))
696
- .subscribe((event) => {
697
- if (!this.submitting) {
698
- if (this.confirm && this.confirmTabs) {
699
- this.triggerConfirm()
700
- .pipe(takeUntil(this._destroy$))
701
- .subscribe((result) => {
702
- if (confirmResultContinue(result)) {
703
- confirmTabGroup.selectedIndex = event.idx;
704
- }
705
- });
706
- }
707
- else {
708
- confirmTabGroup._originalHandleClick(event.tab, event.tabHeader, event.idx);
709
- }
697
+ .pipe(filter(() => !this.submitting), switchMap((event) => {
698
+ if (this.confirm && this.confirmTabs) {
699
+ return this.triggerConfirm()
700
+ .pipe(tap((result) => {
701
+ if (confirmResultContinue(result)) {
702
+ confirmTabGroup.selectedIndex = event.idx;
703
+ }
704
+ }));
710
705
  }
711
- });
706
+ confirmTabGroup._originalHandleClick(event.tab, event.tabHeader, event.idx);
707
+ return of(null);
708
+ }), takeUntil(this._destroy$))
709
+ .subscribe();
712
710
  }
713
711
  _registerConfirmDialogBackdropEscape() {
714
- this._dialogBackdropEscape = !this._dialogRef?.disableClose;
715
- if (this._dialogBackdropEscape) {
716
- this._dialogRef.backdropClick()
717
- .pipe(takeUntil(this._destroy$))
718
- .subscribe(() => {
719
- this._formClose();
720
- });
721
- this._destroy$
722
- .subscribe(() => {
723
- this._dialogRef.disableClose = false;
724
- });
712
+ if (this._dialogRef) {
713
+ this._dialogBackdropEscape = !this._dialogRef?.disableClose;
714
+ if (this._dialogBackdropEscape) {
715
+ this._dialogRef.backdropClick()
716
+ .pipe(takeUntil(this._destroy$))
717
+ .subscribe(() => {
718
+ this._formClose();
719
+ });
720
+ this._destroy$
721
+ .subscribe(() => {
722
+ this._dialogRef.disableClose = false;
723
+ });
724
+ }
725
725
  }
726
726
  }
727
727
  _registerAutocomplete() {