Thread
#compose
    d

    dagomni

    2 years ago
    Am I doing something wrong or onSelected in BottomNavigationItem is not working? 🤔
    BottomNavigationItem(
        modifier = Modifier.fillMaxWidth()
                + Modifier.ripple(enabled = false),
        alwaysShowLabels = true,
        icon = { Icon(vectorResource(item.first)) },
        text = { Text(stringResource(item.second)) } },
        selected = selectedItem == item,
        onSelected = {
            println("println statement that is not getting called")
        }
    )
    l

    Louis Pullen-Freilich [G]

    2 years ago
    Does it work if you remove
    Modifier.ripple
    from there?
    d

    dagomni

    2 years ago
    It does! 😮 Strange
    l

    Louis Pullen-Freilich [G]

    2 years ago
    I think it's because the
    ripple
    is intercepting touch events from the
    BottomNavigationItem
    , so it won't even see the touch events
    This won't be a problem in the future, when touch is separated from ripple 🙂