Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 4.3 and PhoneGap, cant tap link

I am using PhoneGap 2.9 on Galaxy Note 3. I have a layout similar to Facebook mobile's. It has a nav bar that slides out from the left. The issue I am having is that when the the buttons for the nav bar exceed the size of the screen and need to scroll, they are unable to be tapped. That is, they do not perform their expected functions, and the tap/click event does not fire. The nav bar still responds to swiping, and scrolls properly though.

Its almost as if the parent element of the buttons, an HTML nav element, is receiving the touch events, but some sort of imaginary wall is keeping the child elements from being tapped. Any pointers would be appreciated.

edit: In eclipse I noticed that i have been getting some output that I did not get with 4.2.1, or Android 4.2.2

WebViewInputDispatcher blockWebkitDraw
WebViewInputDispatcher blockWebkitDraw lockedfalse
webview                blockWebkitViewMessage = false

edit: I have noticed that the very top button on my navbar is tappable, but only on its upper edge/border area.

like image 829
Mike_G Avatar asked Dec 05 '13 20:12

Mike_G


2 Answers

Turns out this was easily solved by the old CSS transform trick that seems to cure all of Androids webview ills. I just added this css class to the scrolling navbar:

.androidpaintfix {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0, 0, 0);
}
like image 95
Mike_G Avatar answered Oct 04 '22 20:10

Mike_G


I tried with the other answer (modifing the css but it does not work) then I suposse I coulde enable javascript to the webview and this works

WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
like image 37
angel Avatar answered Oct 04 '22 20:10

angel