Samsung S6 Webview css animations issue

泄露秘密 提交于 2019-12-07 14:05:23

We have the exact same issue with CSS animations in our Cordova-app on Samsung S6 5.1.1 webview. We noticed it first with our spinner, but it seems to impact all kinds of CSS animations.

This seems to be a bug in the Android System Webview version 46.0.2490.76. Everything works fine when downgrading to the previous version, and it also works fine when we install a later version of the Webview manually (not yet available in Google play).

Until a new version is in place we have found a hacky workaround that seems to work fine for now.

From JS we create a fake touch-event, typically in our spinner.stop() function, or similar:

        
            if (Modernizr.touch) {
                var e = document.createEvent('TouchEvent');
                e.initTouchEvent();
            }
        
    

This have the same effect as when the user swipes or taps the screen, and the screen repaints.

Use modernizr to check if touch events are available (or implement your own check) to avoid error messages on non-touch devices such as a desktop.

I hope this can be of help until the webview get's updated in Google Play.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!