Thread
#compose
    b

    Bsn Net

    1 year ago
    I think LazyColumn and LazyColumnFor still have bug in the LazyListState scroll position, my scenario : I have list of items (100 items), when I scroll down to say item no 30, then I filter the list, so it only has 10 items, it will crashed java.lang.IllegalStateException: entered drag with non-zero pending scroll: -1403.0696 at androidx.compose.foundation.lazy.LazyListState.onScroll$foundation_release(LazyListState.kt:171) at androidx.compose.foundation.lazy.LazyListState$scrollableController$1.invoke(LazyListState.kt:144) On comparison, when I use ScrollableColumn, it works perfectly
    m

    Mohamed Elfiky

    1 year ago
    same issue
    Jeremy

    Jeremy

    1 year ago
    I've also seen issue in alpha04 if one of the rows within LazyColumn is changed size it will leave a blank space rather than compress
    b

    Bsn Net

    1 year ago
    Guys, do you know how to programmatically scroll to using LazyColumn ?
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    thanks for reporting. we will fix it for alpha05
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    this bug from the stacktrace is probably already fixed in master, so will be in a new release
    Jeremy, are you sure the issue with blank space is reproducible on alpha04, not alpha03? could you please file a bug?
    b

    Bsn Net

    1 year ago
    @Andrey Kulikov is there any scroll to function for lazyColumn?
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    no, we are still working on adding scrollTo() methods on LazyListState, it is not yet ready, sorry
    b

    Bsn Net

    1 year ago
    Ok got it
    Prashant Priyadarshi

    Prashant Priyadarshi

    1 year ago
    @Andrey Kulikov, will the scrollTo() function for LazyListState be available in compose alpha05
    I am also getting the same error for below code , screen is layed out but error is thrown on scroling
    val listState = rememberLazyListState(
    initialFirstVisibleItemIndex = someIndex)
    putting in stack trace message just for reference
    java.lang.IllegalStateException: entered drag with non-zero pending scroll: -657.0
    at androidx.compose.foundation.lazy.LazyListState.onScroll$foundation_release(LazyListState.kt:171)
    at androidx.compose.foundation.lazy.LazyListState$scrollableController$1.invoke(LazyListState.kt:144)
    at androidx.compose.foundation.lazy.LazyListState$scrollableController$1.invoke(LazyListState.kt)
    at androidx.compose.foundation.gestures.ScrollableKt$scrollable$4$scrollCallback$1.onScroll(Scrollable.kt:194)
    at androidx.compose.ui.gesture.ScrollGestureFilterCoordinator$rawDragObserver$1.onDrag-k-4lQ0M(ScrollGestureFilter.kt:177)
    at androidx.compose.ui.gesture.RawDragGestureFilter.onPointerInput-e3WT7_U(RawDragGestureFilter.kt:348)
    at androidx.compose.ui.input.pointer.PointerInputFilter.onPointerEvent-d1fqKvQ(PointerEvent.kt:65)
    at androidx.compose.ui.input.pointer.Node.dispatchToPointerInputFilter(HitPathTracker.kt:536)
    at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:436)
    at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:432)
    at androidx.compose.ui.input.pointer.NodeParent.dispatchChanges(HitPathTracker.kt:286)
    at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:133)
    at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-EhkylT0(PointerInputEventProcessor.kt:72)
    at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.kt:613)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
    at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
    at android.app.Activity.dispatchTouchEvent(Activity.java:2769)
    at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
    at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
    at android.view.View.dispatchPointerEvent(View.java:9517)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4242)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4108)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3654)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3707)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3673)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3799)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3681)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3856)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3654)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3707)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3673)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3681)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3654)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5969)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5908)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5869)
    at android.view.ViewRootImpl$WindowInputEventReceiver.o
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    this crash will be fixed in alpha05. scrollTo will not make it to alpha 05, sorry