Jelly Bean webview app does not respond to touchend events perfectly
Asked Answered
S

2

4

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.

Salutation answered 11/9, 2012 at 7:40 Comment(0)
L
3

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;
}
Limbourg answered 21/2, 2013 at 23:44 Comment(0)
E
2

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

Elflock answered 16/1, 2013 at 23:52 Comment(1)
In that link, the answer that got a bounty (where you read about 'click') was by me :) I had done that too, and it did work in most cases, but there was a particular case where it didn't work.Salutation

© 2022 - 2024 — McMap. All rights reserved.