diff --git a/Sources/ArcGISToolkit/Components/FormView/FormView.swift b/Sources/ArcGISToolkit/Components/FormView/FormView.swift index 2954bf6cc..1705c70f6 100644 --- a/Sources/ArcGISToolkit/Components/FormView/FormView.swift +++ b/Sources/ArcGISToolkit/Components/FormView/FormView.swift @@ -53,8 +53,8 @@ public struct FormView: View { } } } - .onChange(of: model.focusedElement) { focusedElement in - if let focusedElement { + .task(id: model.focusedElement) { + if let focusedElement = model.focusedElement { withAnimation { scrollViewProxy.scrollTo(focusedElement, anchor: .top) } } }