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 created with html data always takes up the whole screen #1297

Closed
dorotatomczak opened this issue Aug 16, 2022 · 4 comments · Fixed by #1397
Closed

WebView created with html data always takes up the whole screen #1297

dorotatomczak opened this issue Aug 16, 2022 · 4 comments · Fixed by #1397
Assignees

Comments

@dorotatomczak
Copy link

Describe the bug

As of right now the LayoutParams are created inside the WebView composable and cannot be changed. The layoutParams are MATCH_PARENT, so the result is that no matter how big is the html content is, it will always take up the whole screen.

To Reproduce

Steps to reproduce the behavior:

  1. Embed WebView inside ModalBottomSheetLayout
  2. Create state by using rememberWebViewStateWithHTMLData with data equal to some small html content and pass the state to the WebVIew
  3. Run the project, open the bottom sheet with webview and see that it takes up the whole screen

Expected behavior

The bottom sheet should be the height of the html content that was passed into the WebView.

Environment:

  • Android OS version: Android 11.0
  • Device: Emulator
  • Accompanist version: 0.24.13-rc

Additional context

My proposal is to pass the LayoutParams as the argument to the WebView, so the programmers would be able to configure it according to their needs.

@bentrengrove
Copy link
Collaborator

Have you tried using a modifier on the composable? If so, which one?

@dorotatomczak
Copy link
Author

Have you tried using a modifier on the composable? If so, which one?

Yes, I tried using Modifier.wrapContentHeight() and Modifier.weight(1f, false)

@bentrengrove bentrengrove self-assigned this Aug 22, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Sep 21, 2022
@bentrengrove bentrengrove removed the stale Stale issues which are marked for closure label Sep 21, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Oct 22, 2022
@bentrengrove bentrengrove removed the stale Stale issues which are marked for closure label Oct 22, 2022
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