Skip to content

Commit

Permalink
Fixes (Wrong selection from filtered result #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaibrahim989 committed Oct 28, 2016
1 parent 867621e commit 0c17a4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/MICountryPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ extension MICountryPicker {
override open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let country: MICountry!
if searchController.searchBar.isFirstResponder {
if searchController.searchBar.text!.characters.count > 0 {
country = filteredList[(indexPath as NSIndexPath).row]
} else {
country = sections[(indexPath as NSIndexPath).section].countries[(indexPath as NSIndexPath).row]
Expand Down

0 comments on commit 0c17a4b

Please sign in to comment.