You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jesse MacFadyen (JIRA)" <ji...@apache.org> on 2013/06/06 03:12:19 UTC

[jira] [Created] (CB-3621) Overriding Back Button behavior can lead to inconsistent state

Jesse MacFadyen created CB-3621:
-----------------------------------

             Summary: Overriding Back Button behavior can lead to inconsistent state 
                 Key: CB-3621
                 URL: https://issues.apache.org/jira/browse/CB-3621
             Project: Apache Cordova
          Issue Type: Bug
          Components: WP7, WP8
    Affects Versions: 2.8.0
            Reporter: Jesse MacFadyen
            Assignee: Jesse MacFadyen
             Fix For: 2.9.0


The current implementation does the following:
- if the app has overridden the back button, by using document.addEventListener, then the backbutton event is passed to the page, and discarded.
- else, the library will call window.history.back and if the page changes, discard the event.

In all other cases the event will be passed to the OS and the app will exit.

It is possible that an app is overriding the backbutton, but still needs the ability to exit at some point ( in response to a backbutton event ).
If the page history has changed, then the framework would swallow the event, so it is impossible to get this behavior.

We need to either add a programmatic way to exit the app in response to a back-button press, or find a way to signal the framework that even though I am overriding the backbutton, the app should still pass the event on to the OS.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira