Hi !, so i have exam features in which i load the ...
# compose-ios
f
Hi !, so i have exam features in which i load the question and options from html and if the keyboard popped up or focused, and i tried to navigate to other page, the other page would randomly blank :
Copy code
@OptIn(ExperimentalTime::class)
@Composable
fun PagerWkWebViewTest() {
    val state = rememberPagerState { 10 }
    HorizontalPager(state = state) {
        Column(horizontalAlignment = Alignment.CenterHorizontally) {
            PlatformSpecificWebView(
                modifier =
                    Modifier
                        .fillMaxWidth()
                        .height(100.dp)
                        .background(Color.Transparent)
                        .clickable {
                        }.animateContentSize(),
                url = {
                    loadHtmlDataIntoWebView(
                        "pUnknown/p",
                        isAnswer = true,
                        isOptions = true,
                    )
                },
                token = "",
                popBack = {},
                isLiveClass = false,
                examMode = true,
                backgroundColorExam = Color.White,
                optionExamId = -1,
                isOption = false,
            )
            TextField(
                value = "",
                onValueChange = {},
                modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp),
            )
        }
    }
}
Copy code
val coord =
    remember {
        WKWebViewExamCoordinator(onSizeChange = {
            heightWebView = it.dp
        })
    }
if (examMode) {
    UIKitView(
        factory = {
            val webView =
                wkwebviewInstance(
                    url = url(),
                    token = token,
                    onSizeChange = {},
                    backgroundColor = Color.Transparent,
                )
            webView.navigationDelegate = coord
            webView.UIDelegate = coord
            webView
        },
        modifier = Modifier.fillMaxWidth().height(heightWebView),
        update = { webView ->
            webView.backgroundColor = backgroundColor.toUiColor()
            webView.loadHTMLString(url(), null)
        },
        onRelease = {
            println("onRelease called on ${url()}")
            it.stopLoading()
            it.removeFromSuperview()
            it.navigationDelegate = null
            it.UIDelegate = null
        },
        properties = UIKitInteropProperties(placedAsOverlay = false),
    )