mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Use animation to try and handle swiftui reverse scrolling bug
This commit is contained in:
parent
99960f0fa8
commit
eefe1f0e12
1 changed files with 6 additions and 9 deletions
|
|
@ -335,20 +335,17 @@ struct UserMessageList: View {
|
|||
self.bleManager.context = context
|
||||
self.bleManager.userSettings = userSettings
|
||||
|
||||
if allMessages.count > 2 {
|
||||
if allMessages.count > 0 {
|
||||
|
||||
scrollView.scrollTo(allMessages.firstIndex(of: allMessages.last! ), anchor: .bottom)
|
||||
withAnimation(Animation.spring().delay(0.5)) {
|
||||
scrollView.scrollTo(allMessages.firstIndex(of: allMessages.last! ), anchor: .bottom)
|
||||
}
|
||||
}
|
||||
})
|
||||
.onChange(of: allMessages.count, perform: { count in
|
||||
|
||||
//self.context.refresh(user, mergeChanges: true)
|
||||
|
||||
let index = count - 1
|
||||
|
||||
if index > 3 {
|
||||
|
||||
scrollView.scrollTo(index, anchor: .bottom)
|
||||
withAnimation(Animation.spring().delay(0.5)) {
|
||||
scrollView.scrollTo(allMessages.firstIndex(of: allMessages.last! ), anchor: .bottom)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue