-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
The WheelView component crashes when used in scenarios where the composable is removed e.g., a bottom sheet is dismissed while the scrolling is still in progress.
Environment
- Compose BOM: 2025.10.00
- Compose Foundation: 1.7.x+
- Android Target SDK: 36
- WheelView version: 2.0.7
Steps to Reproduce
- Display a WheelView inside a bottom sheet or modal dialog
- Scroll the wheel to trigger lazy list prefetching
- Quickly dismiss/close the sheet while scrolling or immediately after
- App crashes with
SubcomposeLayoutPausableCompositionException
Stack Trace
androidx.compose.ui.layout.SubcomposeLayoutPausableCompositionException: slotid=DefaultLazyKey(index=24998)
at
androidx.compose.ui.layout.LayoutNodeSubcompositionsState.applyPausedPrecomposition(SubcomposeLayout.kt:1270)
at androidx.compose.foundation.lazy.layout.PrefetchHandleProvider$HandleAndRequestImpl.performApply(LazyLayout
PrefetchState.kt:798)
at
androidx.compose.foundation.lazy.layout.AndroidPrefetchScheduler.runRequest(PrefetchScheduler.android.kt:181)
...
Caused by: androidx.compose.runtime.ComposePausableCompositionException
Caused by: java.lang.IllegalStateException: **Apply is called on deactivated node LayoutNode@9a08937 children: 0**
measurePolicy: androidx.compose.foundation.text.EmptyMeasurePolicy@7f074a7 deactivated: true
Expected Behavior
WheelView handles composition/deactivation gracefully without crashing, even when a bottom sheet is dismissed during active scrolling or prefetching.
Proposed Fix
Add stable keys and content type to the items() call in the LazyColumn.
- Stable keys ensure Compose can track item identity across recompositions
- Content type enables efficient composition reuse
Testing
Tested with the fix with Compose BOM 2025.10.00 with multiple bottom sheets using WheelView, rapid open/close scenarios → no crashes observed after applying the fix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels