Skip to content

Commit 7240743

Browse files
authored
Merge pull request #267 from AvdLee/main
Fix UI bug in macOS scroll view
2 parents 3ac5ee3 + 8da8679 commit 7240743

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/PulseUI/Features/Console/List/ConsoleListContentView.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ struct ConsoleListContentView: View {
8989
#if os(macOS)
9090
private func registerNowMode<T: View>(for list: T) -> some View {
9191
list.onChange(of: viewModel.entities) { entities in
92-
guard isNowEnabled else { return }
92+
/// From empty to 1 causes a bug on macOS where the first cell falls behind the overflow.
93+
/// Check for count == 1 to always animate to the first inserted item.
94+
guard isNowEnabled || entities.count == 1 else { return }
9395

9496
withAnimation {
9597
proxy.scrollTo(BottomViewID(), anchor: .top)

0 commit comments

Comments
 (0)