Fix dish deletion list flicker with stable identity/order and add regression test
This commit is contained in:
@@ -5,7 +5,7 @@ struct HomeView: View {
|
||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||
@Environment(\.modelContext) private var context
|
||||
@Environment(\.openURL) private var openURL
|
||||
@Query private var dishes: [Dish]
|
||||
@Query(sort: \Dish.createdAt, order: .reverse) private var dishes: [Dish]
|
||||
@Query private var tags: [Tag]
|
||||
@Query(sort: \WeekPlan.weekStartDate, order: .forward) private var weekPlans: [WeekPlan]
|
||||
@Query private var allSettings: [AppSettings]
|
||||
@@ -452,7 +452,7 @@ struct HomeView: View {
|
||||
.padding(24)
|
||||
} else {
|
||||
List {
|
||||
ForEach(filteredDishes) { dish in
|
||||
ForEach(filteredDishes, id: \.id) { dish in
|
||||
Button {
|
||||
onPickDish(dish)
|
||||
dismiss()
|
||||
|
||||
Reference in New Issue
Block a user