You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Richard Burkhardt (JIRA)" <ji...@apache.org> on 2017/07/25 16:16:01 UTC

[jira] [Resolved] (CB-13111) preventDefault() on backbutton event is ignored

     [ https://issues.apache.org/jira/browse/CB-13111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Burkhardt resolved CB-13111.
------------------------------------
    Resolution: Not A Bug

The ionic frameworks service $ionicPlatform adds a default functionality 

use $ionicPlatform.registerBackButtonAction to overrride

> preventDefault() on backbutton event is ignored
> -----------------------------------------------
>
>                 Key: CB-13111
>                 URL: https://issues.apache.org/jira/browse/CB-13111
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-android
>    Affects Versions: 7.0.1
>         Environment: cordova versin 7.0.1
>            Reporter: Richard Burkhardt
>            Assignee: Joe Bowser
>            Priority: Critical
>
> Cordova provides a backbutton event to react to the hardware back button. I have an ionic app that uses a custom navigation model so I need to override the default behavior. I tried this:
> {code:java}
> document.addEventListener("backbutton", function(e) {
>     console.log("backbutton is fired");
>     e.preventDefault();
> }, false);
> {code}
> it outputs the "backbutton is fired" but still navigates the app.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org