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

[Coil 3] Image never loads when using Modifier#matchParentSize() #2186

Open
jan-tennert opened this issue Mar 29, 2024 · 2 comments
Open

[Coil 3] Image never loads when using Modifier#matchParentSize() #2186

jan-tennert opened this issue Mar 29, 2024 · 2 comments
Labels
help wanted Issues that are up for grabs + are good candidates for community PRs

Comments

@jan-tennert
Copy link

jan-tennert commented Mar 29, 2024

Describe the bug
After debugging for hours why my image isn't loading, I found the problem. Using the matchParentSize() modifier on the AsynImage composable causes the image to never load.
Tried it on Android and the JVM target, both have the same problem.

To Reproduce
Small JVM snippet:

application {
    Window(::exitApplication) {
        Box {
            AsyncImage(
                model = "any image url",
                contentDescription = null,
                modifier = Modifier.matchParentSize(), //if you comment out this line, everything works
                onState = ::println
            )
        }
    }
}

Logs/Screenshots
If this modifier is there, only the Loading state gets printed.

Version
3.0.0-alpha06

@colinrtwhite colinrtwhite added the help wanted Issues that are up for grabs + are good candidates for community PRs label Apr 2, 2024
@maanuanubhav999
Copy link

Hey @colinrtwhite I would love to give this a shot, where can I start from, any documentation I should refer to ?

@colinrtwhite
Copy link
Member

@maanuanubhav999 I would take a look at ConstraintsSizeResolver. It sounds possible that it's getting stuck resolving the constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that are up for grabs + are good candidates for community PRs
Projects
None yet
Development

No branches or pull requests

3 participants