#1098 - Various changes following code review.

This commit is contained in:
Stefan Ceriu
2021-10-07 12:21:40 +03:00
parent 0afc917c97
commit 096279b43a
8 changed files with 16 additions and 15 deletions
@@ -33,20 +33,18 @@ struct UserSuggestionListWithInput: View {
var viewModel: UserSuggestionListWithInputViewModel
@State private var inputText: String = ""
var body: some View {
VStack(spacing: 0.0) {
UserSuggestionList(viewModel: viewModel.listViewModel.context)
TextField("Search for user", text: $inputText)
.background(Color.white)
.onChange(of: inputText, perform: { value in
viewModel.callback(value)
})
.border(Color.black)
.onChange(of: inputText, perform:viewModel.callback)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding([.leading, .trailing])
.onAppear(perform: {
.onAppear {
inputText = "@-" // Make the list show all available mock results
})
}
}
}
}