Thread
#compose
    orangy

    orangy

    1 year ago
    I have
    LazyVerticalGrid
    with
    itemsIndexed
    over a property which is
    mutableStateListOf
    . Everything is working fine when I add items, but when I remove items via
    remove
    or
    clear
    on that list I get an exception trying to access non-existing items. It’s a call from inside the
    itemsIndexed
    , looks like it didn’t notice collection has changed. Is it a known issue or am I doing something wrong?
    Same with
    items
    The code is pretty trivial
    LazyVerticalGrid(GridCells.Adaptive(72.dp)) {
                itemsIndexed(inventory.items) { index, it ->
                    Text("${it.thing.name} [${it.amount}]")
                }
            }
    and
    class Inventory() {
        val items = mutableStateListOf<InventoryItem>()
    Exception
    Dominaezzz

    Dominaezzz

    1 year ago
    Yeah I've seen this exception in Slack a couple times.
    orangy

    orangy

    1 year ago
    I see, thanks. @Andrey Kulikov is it yours? 🙂
    Reproducable with desktop compose 0.3.0-rc1, not sure which compose is bundled
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    hey! yes, sorry it is not yet fixed, but I have plan to fix it in upcomming releases. please consider using mutableStateOf immutable lists for now
    louiscad

    louiscad

    1 year ago
    Is there a public issue to follow?
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    orangy

    orangy

    1 year ago
    Yes, I’m using mutable state of immutable list now, it works fine. Thanks.
    I see this issue is marked as fixed, but how do I know if it were already released in some public build? And if it also went to compose-desktop?
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    it was released in beta02 of the android build and in the first desktop release created after 3th of March(basically the latest one should contain it)
    louiscad

    louiscad

    1 year ago
    It'd be so nice that Google's issue tracker shows in a public metadata-field what releases will first include a given fix.