Skip to content

Commit

Permalink
feat: set default focus to textfield in Go to Time alert (non-functio…
Browse files Browse the repository at this point in the history
…nal)
  • Loading branch information
godly-devotion committed Mar 21, 2024
1 parent 151542b commit 90e6df9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Front Row/Views/GoToTimeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI

struct GoToTimeView: View {
@Namespace private var timeNamespace
@Environment(\.dismiss) private var dismiss
@State private var timecode = ""

Expand All @@ -20,6 +21,7 @@ struct GoToTimeView: View {
}
.autocorrectionDisabled()
.lineLimit(1)
.prefersDefaultFocus(in: timeNamespace)

Button("Go") {
dismiss()
Expand All @@ -29,6 +31,7 @@ struct GoToTimeView: View {
dismiss()
}
}
.focusScope(timeNamespace)
}
}

Expand Down

0 comments on commit 90e6df9

Please sign in to comment.