google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.38k stars 596 forks source link

[WebView] WebView loading delay in LazyColumn #1651

Closed ashiqfury closed 1 year ago

ashiqfury commented 1 year ago

Description I have placed WebViews in LazyColumns, where each WebView has a dynamic height. Every time I scroll the list, the WebView loads with a significant delay that looks flickering. I can see only the white screen for 2 seconds after scrolling.

Steps to reproduce

LazyColumn(
    modifier = Modifier
        .fillMaxWidth()
) {
    items(
        count = 100,
        key = {
            it
        }
    ) {
        val state = rememberWebViewStateWithHTMLData(data = "<strong>Strong text $it</strong>")
        WebView(
            state = state,
            modifier = Modifier
                .padding(20.dp),
        )
    }
}

Expected behavior The WebView should render fast when inside LazyColumn.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

KevinnZou commented 1 year ago

Hi, I am wondering did you try it with Recyclerview? Since I think it is reasonable to have delay under such situation.

mouli-011 commented 1 year ago

did anyone find a solution?

trevorwang commented 5 months ago

same issue here.

YugeCse commented 2 months ago

I think that google don't have any plan to resolve the androidview's state question. They gave up to develope the compose webview library. The webView's state restore behavior alway be slow than others.