Skip to content

WebView Desktop - WebView rendered above all views #389

@achatina

Description

@achatina

Hi! I met some strange behavior with rendering the webview. If I have any Dialogs or Progress or any other view that should overlay WebView - WebView always above and this breaks a lot of UI things.

Just a sample of this to see this behavior. Is it something expected and I should play around with this? Or did I do something wrong?

Image
    val webViewState =
        rememberWebViewStateWithHTMLFile(
            fileName = "fileChoose.html",
            readType = WebViewFileReadType.ASSET_RESOURCES,
        )
    val webViewNavigator = rememberWebViewNavigator()

    LaunchedEffect(Unit) {
        webViewState.webSettings.zoomLevel = 1.0

        webViewState.webSettings.apply {
            zoomLevel = 1.0
            logSeverity = KLogSeverity.Debug
            backgroundColor = Color.White
            androidWebSettings.apply {
                isAlgorithmicDarkeningAllowed = true
                safeBrowsingEnabled = true
                allowFileAccess = false
            }
            iOSWebSettings.apply {
                backgroundColor = Color.White
                underPageBackgroundColor = Color.White
            }
        }
    }
                Column {
                    TopAppBar(
                        modifier =
                            Modifier
                                .background(
                                    color = MaterialTheme.colors.primary,
                                ).padding(
                                    top =
                                        WindowInsets.statusBars
                                            .asPaddingValues()
                                            .calculateTopPadding(),
                                ),
                        title = { Text(text = "Html Sample") },
                        navigationIcon = {

                        },
                    )

                    Box(Modifier.fillMaxSize()) {
                        WebView(
                            state = webViewState,
                            modifier = Modifier.height(205.dp).fillMaxWidth(),
                            navigator = webViewNavigator,
                        )

                    }
                }

                AlertDialog(
                    {},
                    {},
                    title = { Text("Title") },
                    text = {
                        Text("This is Alert Dialog")
                    }
                )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions