mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
fix(android): setting hardwareBackButton: false in config now disabled default webview behavior (#22555)
resolves #18237
This commit is contained in:
@ -8,6 +8,20 @@ interface HandlerRegister {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* When hardwareBackButton: false in config,
|
||||
* we need to make sure we also block the default
|
||||
* webview behavior. If we don't then it will be
|
||||
* possible for users to navigate backward while
|
||||
* an overlay is still open. Additionally, it will
|
||||
* give the appearance that the hardwareBackButton
|
||||
* config is not working as the page transition
|
||||
* will still happen.
|
||||
*/
|
||||
export const blockHardwareBackButton = () => {
|
||||
document.addEventListener('backbutton', () => {}); // tslint:disable-line
|
||||
}
|
||||
|
||||
export const startHardwareBackButton = () => {
|
||||
const doc = document;
|
||||
|
||||
|
Reference in New Issue
Block a user