Fix scrambled screen when searchinfg (#2191)

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-11-30 18:47:44 +01:00
committed by GitHub
parent edbac5fe85
commit b7ecb07d2f
3 changed files with 37 additions and 28 deletions
@@ -28,13 +28,15 @@ struct MessageForwardingScreen: View {
}
// Replace these with ScrollView's `scrollPosition` when dropping iOS 16.
} header: {
Rectangle().hidden().onAppear {
context.send(viewAction: .reachedTop)
}
emptyRectangle
.onAppear {
context.send(viewAction: .reachedTop)
}
} footer: {
Rectangle().hidden().onAppear {
context.send(viewAction: .reachedBottom)
}
emptyRectangle
.onAppear {
context.send(viewAction: .reachedBottom)
}
}
.compoundFormSection()
}
@@ -59,6 +61,12 @@ struct MessageForwardingScreen: View {
.compoundSearchField()
.disableAutocorrection(true)
}
/// The greedy size of Rectangle can create an issue with the navigation bar when the search is highlighted, so is best to use a fixed frame instead of hidden() or EmptyView()
private var emptyRectangle: some View {
Rectangle()
.frame(width: 0, height: 0)
}
}
private struct MessageForwardingRoomCell: View {