I'm confused by this exception `java.lang.IllegalS...
# compose
b
I'm confused by this exception
java.lang.IllegalStateException: Nesting scrollable in the same direction layouts like LazyColumn and Column(Modifier.verticalScroll()) is not allowed.
when the compose docs clearly state
Automatic nested scrolling: Simple nested scrolling requires no action on your part. Gestures that initiate a scrolling action are propagated from children to parents automatically, such that when the child can't scroll any further, the gesture is handled by its parent element
The docs then go on to give a sample of nesting one vertical scrolling box inside another vertically scrolling box.
i
Is your
Modifier.verticalScroll()
surrounding the
LazyColumn
? That kind of setup doesn't really make any sense given that
verticalScroll
is effectively makes that element an infinite height...meaning every element in a
LazyColumn
would be loaded at once (as they're all within the bounds of the available height...), thus defeating the whole purpose of
LazyColumn
👍 1
b
If the LazyColumn has a fixed height, it does make sense, technically. I would expect the scroll behaviour to work the same as if I nested two verticalScroll boxes.
It works fine with Android views (ScrollView + RecyclerView).
We use design tools where some of this code is generated, so I try to be generous in what is supported.