mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add empty view for scrolling
This commit is contained in:
parent
2f4436a8cb
commit
0edced69bf
2 changed files with 4 additions and 4 deletions
|
|
@ -614,6 +614,7 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
ScrollViewReader { reader in
|
||||
List(selection: $selection) {
|
||||
Section(content: {
|
||||
EmptyView().id("TOP")
|
||||
if let appliedFilter = viewModel.filterState.appliedFilter,
|
||||
networkMonitor.status == .disconnected,
|
||||
!appliedFilter.allowLocalFetch
|
||||
|
|
@ -689,9 +690,9 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
|
||||
.coordinateSpace(name: "scroll")
|
||||
.onChange(of: shouldScrollToTop) { _ in
|
||||
if shouldScrollToTop, let topItem = viewModel.fetcher.items.first {
|
||||
withAnimation { // add animation for scroll to top
|
||||
reader.scrollTo(topItem.unwrappedID, anchor: .top) // scroll
|
||||
if shouldScrollToTop {
|
||||
withAnimation {
|
||||
reader.scrollTo("TOP", anchor: .top)
|
||||
}
|
||||
}
|
||||
shouldScrollToTop = false
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ struct TabBarButton: View {
|
|||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 28, height: 28)
|
||||
.foregroundColor(selectedTab == key ? Color.blue : Color.themeTabButtonColor)
|
||||
|
||||
.frame(maxWidth: .infinity)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue