Reputation: 693
I am trying to implement WebView in a ModalBottomSheetLayout. Issue is that WebView content is not scrolling inside bottom sheet. It works fine in normal compose view. Couldn't find anything workable. Is there a way to make it working?
Upvotes: 5
Views: 1372
Reputation: 161
I was facing to the same issue but adding
setOnTouchListener { v, event ->
v.parent?.requestDisallowInterceptTouchEvent(true)
v.onTouchEvent(event)
}
to the webView (in the apply block) is fixing the problem !
Upvotes: 0
Reputation: 51
Maybe this can help you? Let me know if this works for you.
Column(
modifier = modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
AndroidView(factory = {
WebView(it).apply {
webViewClient = WebViewClient()
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
)
loadUrl(url)
}
}, update = {
it.loadUrl(url)
}
)
}
Upvotes: 2