diff --git a/src/app/app.component.ts b/src/app/app.component.ts index cd0200f8d..96c56a18a 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -65,6 +65,19 @@ export class MoodleMobileApp implements OnInit { app.setElementClass('platform-windows', true); } } + + // Register back button action to allow closing modals before anything else. + this.appProvider.registerBackButtonAction(() => { + // Following function is hidden in Ionic Code, however there's no solution for that. + const portal = app._getActivePortal(); + if (portal) { + portal.pop(); + + return true; + } + + return false; + }, 2000); }); } diff --git a/src/app/app.scss b/src/app/app.scss index 9fbf324f0..529257037 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -1012,6 +1012,11 @@ ion-app.app-root { ion-alert .alert-checkbox-button .alert-checkbox-label { white-space: normal; } + + ion-backdrop { + transition: opacity 100ms ease-in-out; + opacity: .1; + } } @each $color-name, $color-base, $color-contrast in get-colors($colors) { diff --git a/src/components/context-menu/context-menu.ts b/src/components/context-menu/context-menu.ts index ff6413b67..42fca4504 100644 --- a/src/components/context-menu/context-menu.ts +++ b/src/components/context-menu/context-menu.ts @@ -178,7 +178,7 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy { showContextMenu(event: MouseEvent): void { if (!this.expanded) { const popover = this.popoverCtrl.create(CoreContextMenuPopoverComponent, - { title: this.title, items: this.items, id: this.uniqueId }); + { title: this.title, items: this.items, id: this.uniqueId, showBackdrop: true }); popover.onDidDismiss(() => { this.expanded = false;