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

Exception in ShowcaseContent #23

Open
aphex- opened this issue Jan 14, 2024 · 1 comment
Open

Exception in ShowcaseContent #23

aphex- opened this issue Jan 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@aphex-
Copy link

aphex- commented Jan 14, 2024

Hello. I am getting the following exception:

 java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
     at androidx.compose.ui.node.NodeCoordinator.getParentLayoutCoordinates(NodeCoordinator.kt:256)
     at androidx.compose.ui.layout.LayoutCoordinatesKt.findRootCoordinates(LayoutCoordinates.kt:180)
     at androidx.compose.ui.layout.LayoutCoordinatesKt.boundsInWindow(LayoutCoordinates.kt:134)
     at com.canopas.lib.showcase.component.ShowcaseContentKt.ShowcaseContent(ShowcaseContent.kt:76)
     at com.canopas.lib.showcase.component.ShowcaseContentKt$ShowcasePopup$1$1.invoke(ShowcaseContent.kt:55)
     at com.canopas.lib.showcase.component.ShowcaseContentKt$ShowcasePopup$1$1.invoke(ShowcaseContent.kt:54)

If I debug into the code I can confirm that the 'targetCords.isAttached' is false and the call of 'targetCords.boundsInWindow()' leads to the exception.

My guess is it has something to do with the fact that I am using a LazyColum. But anyway.. It might be better to handle the 'isAttached == false' case in the library than letting the app crash?

@aphex-
Copy link
Author

aphex- commented Jan 14, 2024

Okey this also happens in other situations for example if I want to target a Composable in a 'trailingIcon' of a TextField

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants