cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Andrés Martínez (JIRA) <j...@apache.org>
Subject [jira] [Created] (CB-4547) The menubutton event blocks the next event
Date Thu, 08 Aug 2013 22:24:48 GMT
Jorge Andrés Martínez created CB-4547:
-----------------------------------------

             Summary: The menubutton event blocks the next event
                 Key: CB-4547
                 URL: https://issues.apache.org/jira/browse/CB-4547
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 3.0.0, 2.9.0
         Environment: Compiled in Fedora 17, tested on Android 4.2 LG Optimus G and Galaxy
Note 2
            Reporter: Jorge Andrés Martínez
            Assignee: Joe Bowser


h3. Steps to reproduce
# Download the latest release of [cordova|https://www.apache.org/dyn/closer.cgi/cordova/cordova-3.0.0-src.zip]
# Create a new cordova proyect for android with the create script
# Replace the contents of assets/www/index.html with:

{code:html|title=index.html} 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>Cordova Menu Button Example</title>
    <!-- From: http://docs.phonegap.com/en/3.0.0/cordova_events_events.md.html#menubutton
-->
    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    function onDeviceReady() {
        document.addEventListener("menubutton", onMenuKeyDown, false);
        document.addEventListener("click", onTap, false);
    }

    function onMenuKeyDown(e) {
    	alert("menu: "+e);
    }

    function onTap(e) {
    	alert("click: "+e);
    }

    </script>
  </head>
  <body onload="onLoad()">
  </body>
</html>

{code} 

# Build and install to an Android device

# Press menu and press ok on the alert several times

h3. Expected behavior
The alert("menu") should show up every time menu is pressed

h3. Actual Result
The alert shows up like this:
# menu press: {color:green}It is displayed{color}
# menu press: {color:green}It is displayed{color}
# menu press: {color:red}It is not displayed{color}
# menu press: {color:green}It is displayed{color}
# menu press: {color:red}It is not displayed{color}
and so on.

h3. Another way to reproduce:
# Run the previous cordova application on Android
# Press menu and press ok on the alert twice
# swipe the screen
# Press menu ({color:green}the alert is displayed{color})
# swipe the screen
# Press menu ({color:green}the alert is displayed{color})
# swipe the screen
# Press menu ({color:green}the alert is displayed{color})
and so on....
# Press menu ({color:green}the alert is displayed{color})
# Tap the screen  ({color:red}the alert("click") is not displayed{color})
# Press menu ({color:green}the alert is displayed{color})
# Tap the screen  ({color:red}the alert("click") is not displayed{color})
and so on...

h3. Final thoughts
When the menu button is pressed the next event is ignored.

thanks.

--
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

Mime
View raw message