mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(react): adding hardware back button support, fixes(19819) (#19851)
This commit is contained in:
@ -34,6 +34,13 @@ export class NavManager extends React.Component<NavManagerProps, NavContextState
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (document) {
|
||||||
|
document.addEventListener('ionBackButton', (e: any) => {
|
||||||
|
e.detail.register(0, () => {
|
||||||
|
this.props.history.goBack();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Platforms, getPlatforms as getPlatformsCore, isPlatform as isPlatformCore, Config as CoreConfig } from '@ionic/core';
|
import { Config as CoreConfig, Platforms, getPlatforms as getPlatformsCore, isPlatform as isPlatformCore } from '@ionic/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { IonicReactProps } from '../IonicReactProps';
|
import { IonicReactProps } from '../IonicReactProps';
|
||||||
|
Reference in New Issue
Block a user