svenjacobs / reveal

Reveal effect (coach mark) for Compose Multiplatform targeting Android, iOS, Desktop and Web
MIT License
449 stars 8 forks source link

revealing a component inside an AlertDialog() Composable doesn't work properly #159

Closed JihedLablak closed 3 weeks ago

JihedLablak commented 2 months ago

I tried revealing a component and that component happens to be inside an alert dialog but it didn't work as expected

svenjacobs commented 2 months ago

Hello @JihedLablak,

thanks for the bug report. I think the issue is similar to this one. The reason why the reveal effect isn't working is that alert dialogs use the base class Dialog, which when digging deeper ultimately uses AbstractComposeView for the content. So this is a new Android View which is added to the view hierarchy. It is independent from the composition of your main content and has it's own composition.

As a workaround, please try to use a separate RevealCanvas for the content of your alert dialog. If that is not working, try to pass FullscreenRevealOverlayInserter from the reveal-compat-android artifact to the overlayInserter argument of RevealCanvas.

Please let me know if any of these solutions is working for you.

svenjacobs commented 3 weeks ago

Closing because of inactivity.