Skip to content

Commit fd3d195

Browse files
committed
Add comment to clarify the reason behind trimming the search term
1 parent 32fb3c9 commit fd3d195

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/CountrySelectorCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ final class CountrySelectorCommand: ObservableListSelectorCommand {
4848
return data = countries
4949
}
5050

51+
// Trim the search term to remove newlines or whitespaces (e.g added from the keyboard predictive text) from both ends
5152
data = countries.filter { $0.name.localizedCaseInsensitiveContains(term.trim()) }
5253
}
5354
}

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/StateSelectorCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ final class StateSelectorCommand: ObservableListSelectorCommand {
4848
return data = states
4949
}
5050

51+
// Trim the search term to remove newlines or whitespaces (e.g added from the keyboard predictive text) from both ends
5152
data = states.filter { $0.name.localizedCaseInsensitiveContains(term.trim()) }
5253
}
5354
}

0 commit comments

Comments
 (0)