mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
ChannelMessageList and UserMessageList: scroll to bottom onFirstAppear
This commit is contained in:
parent
ee1a7c4415
commit
e0f0b4a0f7
2 changed files with 6 additions and 0 deletions
|
|
@ -130,6 +130,9 @@ struct ChannelMessageList: View {
|
|||
.defaultScrollAnchorTopAlignment()
|
||||
.defaultScrollAnchorBottomSizeChanges()
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.onFirstAppear {
|
||||
debouncedScrollToBottom(scrollView: scrollView, lastMessageId: lastMessageId, delay: 0.1)
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { _ in
|
||||
// Keyboard is about to appear: keyboard show animation hasn't quite started yet.
|
||||
// Schedule an immediate scroll to the bottom message by its messageId, in order to force LazyVStack to render that cell if it isn't rendered already
|
||||
|
|
|
|||
|
|
@ -128,6 +128,9 @@ struct UserMessageList: View {
|
|||
.defaultScrollAnchorTopAlignment()
|
||||
.defaultScrollAnchorBottomSizeChanges()
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.onFirstAppear {
|
||||
debouncedScrollToBottom(scrollView: scrollView, lastMessageId: lastMessageId, delay: 0.1)
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { _ in
|
||||
// Keyboard is about to appear: keyboard show animation hasn't quite started yet.
|
||||
// Schedule an immediate scroll to the bottom message by its messageId, in order to force LazyVStack to render that cell if it isn't rendered already
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue