We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56c543b commit dd313a1Copy full SHA for dd313a1
src/components/vue-tel-input.vue
@@ -236,10 +236,13 @@ export default {
236
if (!this.dropdownOptions.showSearchBox) {
237
return countriesList;
238
}
239
+ const userInput = this.searchQuery;
240
+ const cleanInput = userInput.replace(/[~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?-_]/g, '');
241
+
242
return countriesList.filter(
- (c) => (new RegExp(this.searchQuery, 'i')).test(c.name)
- || (new RegExp(this.searchQuery, 'i')).test(c.iso2)
- || (new RegExp(this.searchQuery, 'i')).test(c.dialCode),
243
+ (c) => (new RegExp(cleanInput, 'i')).test(c.name)
244
+ || (new RegExp(cleanInput, 'i')).test(c.iso2)
245
+ || (new RegExp(cleanInput, 'i')).test(c.dialCode),
246
);
247
},
248
phoneObject() {
0 commit comments