mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
fix(back-button): subscribe to body
This commit is contained in:
@ -21,7 +21,7 @@ export class NavController {
|
|||||||
private location: Location,
|
private location: Location,
|
||||||
@Optional() private router?: Router
|
@Optional() private router?: Router
|
||||||
) {
|
) {
|
||||||
window && window.addEventListener('ionBackButton', (ev) => {
|
window && window.document.body.addEventListener('ionBackButton', (ev) => {
|
||||||
(ev as BackButtonEvent).detail.register(0, () => this.goBack());
|
(ev as BackButtonEvent).detail.register(0, () => this.goBack());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
"unpkg": "dist/ionic.js",
|
"unpkg": "dist/ionic.js",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"dist/",
|
||||||
"css/"
|
"css/",
|
||||||
|
"loader/"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ionicons": "4.4.3"
|
"ionicons": "4.4.3"
|
||||||
|
@ -23,7 +23,7 @@ export function startHardwareBackButton(win: Window) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
win.dispatchEvent(ev);
|
win.document.body.dispatchEvent(ev);
|
||||||
|
|
||||||
if (handlers.length > 0) {
|
if (handlers.length > 0) {
|
||||||
let selectedPriority = Number.MIN_SAFE_INTEGER;
|
let selectedPriority = Number.MIN_SAFE_INTEGER;
|
||||||
|
Reference in New Issue
Block a user