Skip to content

Commit 859ca64

Browse files
committed
Make chat input field the first responder
1 parent c3064b0 commit 859ca64

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionPanelContent/ChatPanel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ struct ChatPanelInputArea: View {
124124
@ObservedObject var chat: ChatRoom
125125
var inputAreaNamespace: Namespace.ID
126126
@Binding var typedMessage: String
127+
@FocusState var isInputAreaFocused: Bool
127128

128129
var body: some View {
129130
HStack {
@@ -148,6 +149,7 @@ struct ChatPanelInputArea: View {
148149
TextField("Type a message", text: $typedMessage)
149150
}
150151
}
152+
.focused($isInputAreaFocused)
151153
.lineLimit(3)
152154
.multilineTextAlignment(.leading)
153155
.textFieldStyle(.plain)
@@ -179,6 +181,9 @@ struct ChatPanelInputArea: View {
179181
.buttonStyle(.plain)
180182
.xcodeStyleFrame()
181183
}
184+
.onAppear {
185+
isInputAreaFocused = true
186+
}
182187
}
183188
}
184189

0 commit comments

Comments
 (0)