Skip to content

Commit

Permalink
Fix UI bug in macOS scroll view
Browse files Browse the repository at this point in the history
  • Loading branch information
AvdLee committed Jun 24, 2024
1 parent 9036403 commit 8da8679
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ struct ConsoleListContentView: View {
#if os(macOS)
private func registerNowMode<T: View>(for list: T) -> some View {
list.onChange(of: viewModel.entities) { entities in
guard isNowEnabled else { return }
/// From empty to 1 causes a bug on macOS where the first cell falls behind the overflow.
/// Check for count == 1 to always animate to the first inserted item.
guard isNowEnabled || entities.count == 1 else { return }

withAnimation {
proxy.scrollTo(BottomViewID(), anchor: .top)
Expand Down

0 comments on commit 8da8679

Please sign in to comment.