I have a problem with `PullRefreshIndicator` ; it ...
# compose
n
I have a problem with
PullRefreshIndicator
; it stays stuck half-way down the screen and does not refresh anything. Here is my code: 🧵
Copy code
val isRefreshing by viewModel.isRefreshing.collectAsState()
    val pullRefreshState = rememberPullRefreshState(refreshing = isRefreshing, onRefresh = {
                viewModel.updateLocalFeeds()
    })
    Scaffold(
        vignette = { Vignette(vignettePosition = VignettePosition.TopAndBottom) },
        positionIndicator = { PositionIndicator(scalingLazyListState = scalingLazyListState) },
        timeText = { TimeText() }
    ) {
        when {
            state.isLoading -> {
                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
                    CircularProgressIndicator()
                }
            }

            state.isSuccess -> {
                Box(modifier = Modifier.pullRefresh(pullRefreshState)) {
                    ScalingLazyColumn(
                        state = scalingLazyListState,
                        modifier = Modifier.fillMaxWidth(),
                        anchorType = ScalingLazyListAnchorType.ItemStart,
                        contentPadding = PaddingValues(
                            horizontal = 8.dp,
                        ),
                        horizontalAlignment = Alignment.CenterHorizontally
                    ) {
                        item {
                            if (title != null) {
                                Text(
                                    text = title, textAlign = TextAlign.Center,
                                    modifier = Modifier.padding(
                                        top = 30.dp,
                                        start = 20.dp,
                                        end = 20.dp,
                                        bottom = 10.dp
                                    )
                                )
                            }

                        }
                        items(state.newsFeedItems) { item ->
                            ResultsChip(item, navController)
                        }
                    }
                    PullRefreshIndicator(
                        modifier = Modifier.align(Alignment.TopCenter),
                        refreshing = isRefreshing,
                        state = pullRefreshState,
                    )
                }
            }
Am I doing anything wrong?