Fix list view scroll position on click next article button

This commit is contained in:
Ash 2022-10-08 21:06:37 +08:00
parent 850a2317ef
commit 352fe36980

View File

@ -37,6 +37,12 @@ class ReadingViewModel @Inject constructor(
if (it.feed.isFullContent) internalRenderFullContent() if (it.feed.isFullContent) internalRenderFullContent()
else renderDescriptionContent() else renderDescriptionContent()
} }
// java.lang.NullPointerException: Attempt to invoke virtual method
// 'boolean androidx.compose.ui.node.LayoutNode.getNeedsOnPositionedDispatch$ui_release()'
// on a null object reference
if (_readingUiState.value.listState.firstVisibleItemIndex != 0) {
_readingUiState.value.listState.scrollToItem(0)
}
hideLoading() hideLoading()
} }
} }