listless

A simple list app for Apple platforms
Log | Files | Refs | README | LICENSE

commit f38f29a986b61bcc3fa9dda5588be97137007dd2
parent ee71286186f5f7444721b10410d055437707777a
Author: Michael Camilleri <[email protected]>
Date:   Wed, 11 Mar 2026 08:41:08 +0900

Fix crash when trying to scroll to the phantom row

Diffstat:
MListlessiOS/Views/TaskListView.swift | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ListlessiOS/Views/TaskListView.swift b/ListlessiOS/Views/TaskListView.swift @@ -455,7 +455,8 @@ struct TaskListView: View, TaskListViewProtocol { } if case .task(let id) = (newValue ?? fState.focusedField), - draggedTaskID == nil + draggedTaskID == nil, + id != Self.phantomRowID { withAnimation { scrollProxy.scrollTo(id) @@ -463,7 +464,7 @@ struct TaskListView: View, TaskListViewProtocol { } } .onChange(of: fState.selectedTaskID) { _, newID in - if let newID, draggedTaskID == nil { + if let newID, draggedTaskID == nil, newID != Self.phantomRowID { withAnimation { scrollProxy.scrollTo(newID) }