Browse Source

Merge pull request #19545 from abpframework/issue-19310

Update logic of showing a confirmation before refreshing the page
pull/19553/head
Masum ULU 2 years ago
committed by GitHub
parent
commit
71272d6ce8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

3
npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

@ -206,8 +206,7 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
fromEvent(window, 'beforeunload')
.pipe(takeUntil(this.destroy$))
.subscribe(event => {
// TODO: check this
if (!this.isFormDirty || this.suppressUnsavedChangesWarning) {
if (this.isFormDirty && !this.suppressUnsavedChangesWarning) {
event.preventDefault();
}
});

Loading…
Cancel
Save