Rahul Dole
Rahul Dole

Reputation: 3093

Jelly Bean webview app does not respond to touchend events perfectly

My webview app works fine with touchend events in android version older than Jelly Bean. But in Jelly Bean, the touchend events are not reliable. Especially on divs that are scrollable, the touchend events are not fired sometimes and the whole app stops responding to any touchend events and I get the Log message with the tag "webcoreglue" and text "Should not happen: no rect-based-test nodes found" Now after i scroll even little bit, it starts responding to touchend normally. Pls help.

HTML

<div id="srpanel" class="panel">
    <div class="main sr-list">
        <div class="sr-list-item-action">
        </div>
    </div>
</div>

JS

$('.sr-list-item-action').bind('touchend', function(){
//some code
});

I am using the div 'sr-list-item-action' in a for loop for each item in the list. So, clicking on an item in the list works only some times. Otherwise when it doesn't work, the whole screen is actually frozen and stops receiving any touchend events, until i scroll. Other thing i observed is, this happens more when i do a $(document).scrollTop(); when i go to the next page of the list. Not sure if this is related.

Upvotes: 4

Views: 3730

Answers (2)

Andrei Rosca
Andrei Rosca

Reputation: 1097

Had the exact same problem. After many sleepless nights this saved me:

window,html,body {
    overflow-x:hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overflow: scroll !important;
}

Upvotes: 3

cclerv
cclerv

Reputation: 2969

Change all your 'touchend' to 'click' in side your bind. This worked for me. This linked was helpful: Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

Upvotes: 2

Related Questions