mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(modals): application activityBackPressed event not fired for modals (#6261)
This commit is contained in:
committed by
vakrilov
parent
8a5f73055e
commit
8575c60b13
@@ -1,7 +1,6 @@
|
||||
// Definitions.
|
||||
import { Point, CustomLayoutView as CustomLayoutViewDefinition, dip } from ".";
|
||||
import { GestureTypes, GestureEventData } from "../../gestures";
|
||||
import { AndroidActivityBackPressedEventData } from "../../../application";
|
||||
// Types.
|
||||
import {
|
||||
ViewCommon, layout, isEnabledProperty, originXProperty, originYProperty, automationTextProperty, isUserInteractionEnabledProperty,
|
||||
@@ -22,6 +21,7 @@ import {
|
||||
import { Background, ad as androidBackground } from "../../styling/background";
|
||||
import { profile } from "../../../profiling";
|
||||
import { topmost } from "../../frame/frame-stack";
|
||||
import { AndroidActivityBackPressedEventData, android as androidApp } from "../../../application";
|
||||
|
||||
export * from "./view-common";
|
||||
|
||||
@@ -107,6 +107,13 @@ function initializeDialogFragment() {
|
||||
activity: view._context,
|
||||
cancel: false,
|
||||
};
|
||||
|
||||
// Fist fire application.android global event
|
||||
androidApp.notify(args);
|
||||
if (args.cancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
view.notify(args);
|
||||
|
||||
if (!args.cancel && !view.onBackPressed()) {
|
||||
|
||||
Reference in New Issue
Block a user