cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon MacDonald (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CB-1691) Android menu button event doesn't fire when textbox has focus.
Date Mon, 29 Oct 2012 20:30:12 GMT

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

Simon MacDonald resolved CB-1691.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0

I had to check in DroidGap if the menu key was pressed in a text view. If it was call CordovaWebView.onKeyUp.
Additionally I had to keep track of the last menu event as on 4.x devices you can get a double
menubutton event if you are in a text field and the soft keyboard is not being shown.

Tested on 2.2, 2.3, 4.0 and 4.1.
                
> Android menu button event doesn't fire when textbox has focus.
> --------------------------------------------------------------
>
>                 Key: CB-1691
>                 URL: https://issues.apache.org/jira/browse/CB-1691
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.8.1, 1.9.0, 2.0.0, 2.1.0
>         Environment: Android 4.0.3
> Using PhoneGap Build
>            Reporter: AGreenhill
>            Assignee: Simon MacDonald
>             Fix For: 2.2.0
>
>
> Amir over in the PhoneGap Build support forums told me to report this here. I have set
up a simple app on my HTC Evo 3D (Android 4.0.3), here is the code:
> <!DOCTYPE HTML>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
> <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
> <script type="text/javascript">
> function onDeviceReady()
> {
> document.addEventListener("menubutton", clickMenu, false);
> }
> function clickMenu()
> {
> alert('menu was clicked!');
> }
> </script>
> </head>
> <body onLoad='document.addEventListener("deviceready", onDeviceReady, false);'>
> <input type=button value="Click me to switch focus away from textbox." /><br
/>
> <input type=text />
> </body>
> </html>
> The menu button will fire without issue... until the text box receives focus, then it
fails to fire. I believe the back button has problems too. I have not tested the search button
for this behavior.
> I compiled the app under various versions to see which allowed menu button functionality.
Below are the results.
> 1.4.1 ok
> 1.5.0 ok
> 1.6.1 ok
> 1.7.0 ok
> 1.8.1 fails
> 1.9.0 fails
> 2.0.0 fails
> 2.1.0 fails

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