From 90e6df9bf4099a74daa5472aaf7db467a18d6d30 Mon Sep 17 00:00:00 2001 From: godly-devotion Date: Thu, 21 Mar 2024 15:39:34 -0400 Subject: [PATCH] feat: set default focus to textfield in Go to Time alert (non-functional) --- Front Row/Views/GoToTimeView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Front Row/Views/GoToTimeView.swift b/Front Row/Views/GoToTimeView.swift index 5da7d05..1508c66 100644 --- a/Front Row/Views/GoToTimeView.swift +++ b/Front Row/Views/GoToTimeView.swift @@ -8,6 +8,7 @@ import SwiftUI struct GoToTimeView: View { + @Namespace private var timeNamespace @Environment(\.dismiss) private var dismiss @State private var timecode = "" @@ -20,6 +21,7 @@ struct GoToTimeView: View { } .autocorrectionDisabled() .lineLimit(1) + .prefersDefaultFocus(in: timeNamespace) Button("Go") { dismiss() @@ -29,6 +31,7 @@ struct GoToTimeView: View { dismiss() } } + .focusScope(timeNamespace) } }