Fix for CB-1960, we now check to see if any view is on the WebView, since they won't always be custom

This commit is contained in:
Joe Bowser 2012-12-04 09:40:57 -08:00
parent c0ee593c10
commit 8a19769a47

View File

@ -1008,8 +1008,10 @@ public class DroidGap extends Activity implements CordovaInterface {
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) public boolean onKeyUp(int keyCode, KeyEvent event)
{ {
//Get whatever has focus!
View childView = appView.getFocusedChild();
//Determine if the focus is on the current view or not //Determine if the focus is on the current view or not
if (appView.getHitTestResult() != null && if (appView.getHitTestResult() != null && childView == null &&
appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE && appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
(keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU)) { (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU)) {
return appView.onKeyUp(keyCode, event); return appView.onKeyUp(keyCode, event);