You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "AGreenhill (JIRA)" <ji...@apache.org> on 2012/10/19 19:30:14 UTC

[jira] [Created] (CB-1691) Android menu button event doesn't fire when textbox has focus.

AGreenhill created CB-1691:
------------------------------

             Summary: 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: 2.0.0, 1.9.0, 1.8.1, 2.1.0
         Environment: Android 4.0.3
Using PhoneGap Build
            Reporter: AGreenhill
            Assignee: Joe Bowser
             Fix For: 1.7.0, 1.6.1, 1.5.0, 1.4.0


Amir over in the PhoneGap Build support forums told me to report this here. I have set up a simple Android app, 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

[jira] [Commented] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486134#comment-13486134 ] 

Simon MacDonald commented on CB-1691:
-------------------------------------

Hey Joe,

Have you ever looked at this issue? If I add the following code in DroidGap.onKeyUp 

        else if (appView.getHitTestResult() != null && 
                appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
                keyCode == KeyEvent.KEYCODE_MENU) {
                        return appView.onKeyUp(keyCode, event);
        }

the menubutton event will be fired if the cursor is in the text field.

However, on Android 4.X the menubutton even is fired one time when cursor is in in the input field with the keyboard showing. If the cursor is in the input field and the keyboard is not showing then it is fired twice.

Arg!

                
> 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: Joe Bowser
>
> 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

[jira] [Updated] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser updated CB-1691:
---------------------------

    Fix Version/s:     (was: 1.6.1)
                       (was: 1.7.0)
                       (was: 1.5.0)
                       (was: 1.4.0)
    
> 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: Joe Bowser
>
> 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

[jira] [Reopened] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser reopened CB-1691:
----------------------------

    
> 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: Joe Bowser
>
> 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

[jira] [Assigned] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon MacDonald reassigned CB-1691:
-----------------------------------

    Assignee: Simon MacDonald  (was: Joe Bowser)
    
> 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
>
> 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

[jira] [Resolved] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
     [ 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

[jira] [Resolved] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-1691.
----------------------------

    Resolution: Fixed
    
> 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: Joe Bowser
>
> 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

[jira] [Updated] (CB-1691) Android menu button event doesn't fire when textbox has focus.

Posted by "AGreenhill (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

AGreenhill updated CB-1691:
---------------------------

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

  was:
Amir over in the PhoneGap Build support forums told me to report this here. I have set up a simple Android app, 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

    
> 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: Joe Bowser
>             Fix For: 1.4.0, 1.5.0, 1.6.1, 1.7.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