Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView navigator brittle #246

Open
SamCosta1 opened this issue Oct 28, 2024 · 1 comment · May be fixed by #247
Open

WebView navigator brittle #246

SamCosta1 opened this issue Oct 28, 2024 · 1 comment · May be fixed by #247

Comments

@SamCosta1
Copy link

Under certain conditions the WebViewNavigator does not work at all. Calling the methods on the navigator has no effect.

Reproduction sample
(Only reproduced on Desktop)

@Composable
internal fun BasicWebViewSample() {
    val initialUrl = "https://github.com/KevinnZou/compose-webview-multiplatform"
    val state = rememberWebViewState(url = initialUrl)
    val navigator = rememberWebViewNavigator()

    Column {
        IconButton(onClick = {
            navigator.navigateBack()
        }) {
            Icon(
                imageVector = Icons.Default.ArrowBack,
                contentDescription = "Back",
            )
        }

        WebView(
            state = state,
            modifier =
            Modifier
                .fillMaxSize(),
            navigator = navigator,
        )
    }
}
  1. Load the sample
  2. Click into some link on the page (so there's something to navigate back to)
  3. Tap the back arrow - Nothing happens.

Note: In the sample in the repo this works fine, this seems to have something to do with the fact the sample has a navigator passed in as a param.

It seems a change to the value on this line does not trigger a recomposition correctly.

@SamCosta1 SamCosta1 linked a pull request Oct 28, 2024 that will close this issue
@SamC-Apadmi
Copy link

@KevinnZou Can this be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants