Skip to content

Commit 60877db

Browse files
authored
Fix layout coordinates crash (#24)
1 parent 38f1852 commit 60877db

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

showcase/src/main/java/com/canopas/lib/showcase/component/ShowcaseContent.kt

+10-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ fun ShowcasePopup(
5151
onShowCaseCompleted: () -> Unit,
5252
) {
5353
state.currentTarget?.let {
54-
ShowcaseWindow {
55-
ShowcaseContent(
56-
target = it,
57-
dismissOnClickOutside = dismissOnClickOutside
58-
) {
59-
state.currentTargetIndex++
60-
if (state.currentTarget == null) {
61-
onShowCaseCompleted()
54+
if (it.coordinates.isAttached) {
55+
ShowcaseWindow {
56+
ShowcaseContent(
57+
target = it,
58+
dismissOnClickOutside = dismissOnClickOutside
59+
) {
60+
state.currentTargetIndex++
61+
if (state.currentTarget == null) {
62+
onShowCaseCompleted()
63+
}
6264
}
6365
}
6466
}

0 commit comments

Comments
 (0)