Skip to content

Commit 69f518e

Browse files
committed
PR feedback
1 parent 9c2dcab commit 69f518e

File tree

1 file changed

+4
-4
lines changed
  • ui/core/src/commonMain/kotlin/com/tunjid/heron/ui

1 file changed

+4
-4
lines changed

ui/core/src/commonMain/kotlin/com/tunjid/heron/ui/Tabs.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ private fun BoxScope.Indicator(
213213

214214
val item = visibleItemsInfo[visibleIndex]
215215

216-
val isCompletelyVisible =
217-
item.offset > 0 && item.offset + item.size > layoutInfo.viewportEndOffset
216+
val isFullyVisible = item.offset >= 0 &&
217+
(item.offset + item.size) <= layoutInfo.viewportEndOffset
218218

219-
if (isCompletelyVisible) null else roundedIndex
219+
if (isFullyVisible) null else roundedIndex
220220
}
221221
.collect { index ->
222222
if (index != null) lazyListState.animateScrollToItem(index)
@@ -274,7 +274,7 @@ private fun BoxScope.Indicator(
274274
}
275275

276276
private fun LazyListItemInfo?.tabSizeAndPosition() =
277-
if (this != null) TabSizeAndPosition(size = this.size, position = 0)
277+
if (this != null) TabSizeAndPosition(size = size, position = offset)
278278
else TabSizeAndPosition(0, 0)
279279

280280
@JvmInline

0 commit comments

Comments
 (0)