set isClosing before cancel() to prevent content observer fighting dismiss

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-03-02 11:13:50 +02:00
parent 88354a69d3
commit b7ba2d3f0f
@@ -331,6 +331,9 @@ class BottomSheetView(
fun dismiss() {
val dialog = this.dialog ?: return
// Mark as closing so the content observer doesn't fight the dismiss
// animation by calling updateLayout() mid-hide.
this.isClosing = true
// Temporarily make cancelable so cancel() works — cancel() gives the
// slide-out animation, while dismiss() does a plain fade.
dialog.setCancelable(true)