Skip to content

Commit

Permalink
Fix the room list spasming when reaching the top after having scrolle…
Browse files Browse the repository at this point in the history
…d down
  • Loading branch information
stefanceriu committed Jan 26, 2024
1 parent ffbfdfa commit d911e4f
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions ElementX/Sources/Screens/HomeScreen/View/HomeScreenContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,28 @@ struct HomeScreenContent: View {
.layoutPriority(1)
}
case .rooms:
LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) {
Section {
if context.viewState.shouldShowFilters {
// Showing empty views in pinned headers makes the room list spasm when reaching the top
LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) {
Section {
HomeScreenRoomList(context: context)
} header: {
topSection
}
}
.searchable(text: $context.searchQuery)
.compoundSearchField()
.disableAutocorrection(true)
} else {
topSection

LazyVStack(spacing: 0) {
HomeScreenRoomList(context: context)
} header: {
topSection
}
.searchable(text: $context.searchQuery)
.compoundSearchField()
.disableAutocorrection(true)
}
.searchable(text: $context.searchQuery)
.compoundSearchField()
.disableAutocorrection(true)
case .migration:
EmptyView()
}
Expand Down

0 comments on commit d911e4f

Please sign in to comment.