SearchTextField
SearchTextField copied to clipboard
Reset filterStrings to a textField will cause tableView showed
Reproduce steps are
- Write a SearchTextField, set some filterStrings
- Interacting with it
- Programmatically set some filterStrings again.
And then the SearchTextField will show the suggestion tableView again. Even the SearchTextField is not in interacting state (resignTheFirstResponse). That's quite a problem for dynamic filterStrings situation.
I change the visibility code to the
tableView.isHidden = !isFirstResponder || (filteredResults.count == 0)
shadowView?.isHidden = !isFirstResponder || (filteredResults.count == 0)
To avoid it for now.
I face a smiliar issue.
To prevent duplicated values between several fields, I update the filterStrings accordingly for each fields. But when I do that, there is an odd display of tableview.
I am facing the same issue. i am using textField in table cell and on reload table view all cells showing filtered results on all fields. Any solutions?
i did this workaround self.textfieldname.filterStrings(list) self.textfieldname.becomeFirstResponder() self.textfieldname.resignFirstResponder()
Hi,
I have the same issue here. The workaround above didn't woked for me. When I update the content of the suggestion list, the filtered results appear (without focussing the SearchTextField)
Can someone help?
Thanks.
Simply calling searchTextField.textFieldDidEndEditing()
after setting filterItems
(or filterStrings
) worked for me.
e.g
self.txtInput.filterItems(self.recentCommands.map { SearchTextFieldItem(title: $0) })
self.txtInput.textFieldDidEndEditing()